RDMnet  0.3.0
Implementation of ANSI E1.33 (RDMnet)
View other versions:
rdm_response.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 ETC Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************
16  * This file is a part of RDMnet. For more information, go to:
17  * https://github.com/ETCLabs/RDMnet
18  *****************************************************************************/
19 
22 
23 #ifndef RDMNET_CPP_MESSAGE_TYPES_RDM_RESPONSE_H_
24 #define RDMNET_CPP_MESSAGE_TYPES_RDM_RESPONSE_H_
25 
26 #include <cstddef>
27 #include <cstdint>
28 #include <vector>
29 #include "etcpal/common.h"
30 #include "etcpal/cpp/error.h"
31 #include "etcpal/pack.h"
32 #include "rdm/cpp/message.h"
33 #include "rdm/cpp/uid.h"
34 #include "rdmnet/defs.h"
35 #include "rdmnet/message.h"
36 
37 namespace rdmnet
38 {
39 class SavedRdmResponse;
40 
47 {
48 public:
50  RdmResponse() = delete;
52  RdmResponse(const RdmResponse& other) = delete;
54  RdmResponse& operator=(const RdmResponse& other) = delete;
55 
56  constexpr RdmResponse(const RdmnetRdmResponse& c_resp) noexcept;
57 
58  constexpr rdm::Uid rdmnet_source_uid() const noexcept;
59  constexpr uint16_t source_endpoint() const noexcept;
60  constexpr uint32_t seq_num() const noexcept;
61 
62  constexpr rdm::Uid original_cmd_source_uid() const noexcept;
63  constexpr rdm::Uid original_cmd_dest_uid() const noexcept;
64  constexpr rdm::CommandHeader original_cmd_header() const noexcept;
65  constexpr const uint8_t* original_cmd_data() const noexcept;
66  constexpr uint8_t original_cmd_data_len() const noexcept;
67 
68  constexpr rdm::Uid rdm_source_uid() const noexcept;
69  constexpr rdm::Uid rdm_dest_uid() const noexcept;
70  constexpr rdm_response_type_t response_type() const noexcept;
71  constexpr uint16_t subdevice() const noexcept;
72  constexpr rdm_command_class_t command_class() const noexcept;
73  constexpr uint16_t param_id() const noexcept;
74  constexpr rdm::ResponseHeader rdm_header() const noexcept;
75  constexpr const uint8_t* data() const noexcept;
76  constexpr size_t data_len() const noexcept;
77  constexpr bool more_coming() const noexcept;
78 
79  constexpr bool OriginalCommandIncluded() const noexcept;
80  constexpr bool HasData() const noexcept;
81  constexpr bool IsFromDefaultResponder() const noexcept;
82  constexpr bool IsResponseToMe() const noexcept;
83 
84  constexpr bool IsAck() const noexcept;
85  constexpr bool IsNack() const noexcept;
86 
87  constexpr bool IsGetResponse() const noexcept;
88  constexpr bool IsSetResponse() const noexcept;
89 
90  etcpal::Expected<rdm::NackReason> GetNackReason() const noexcept;
91  std::vector<uint8_t> GetData() const;
92  std::vector<uint8_t> GetOriginalCmdData() const;
93 
94  constexpr const RdmnetRdmResponse& get() const noexcept;
95 
96  rdm::Command OriginalCommandToRdm() const;
97  rdm::Response ToRdm() const;
98  SavedRdmResponse Save() const;
99 
100 private:
101  const RdmnetRdmResponse& resp_;
102 };
103 
111 {
112 public:
114  SavedRdmResponse() = default;
117  SavedRdmResponse(const RdmResponse& resp);
118  SavedRdmResponse& operator=(const RdmResponse& resp);
119 
120  const rdm::Uid& rdmnet_source_uid() const noexcept;
121  uint16_t source_endpoint() const noexcept;
122  uint32_t seq_num() const noexcept;
123 
124  rdm::Uid original_cmd_source_uid() const noexcept;
125  rdm::Uid original_cmd_dest_uid() const noexcept;
126  const rdm::CommandHeader& original_cmd_header() const noexcept;
127  const uint8_t* original_cmd_data() const noexcept;
128  uint8_t original_cmd_data_len() const noexcept;
129  const rdm::Command& original_cmd() const noexcept;
130 
131  rdm::Uid rdm_source_uid() const noexcept;
132  rdm::Uid rdm_dest_uid() const noexcept;
133  rdm_response_type_t response_type() const noexcept;
134  uint16_t subdevice() const noexcept;
135  rdm_command_class_t command_class() const noexcept;
136  uint16_t param_id() const noexcept;
137  const rdm::ResponseHeader& rdm_header() const noexcept;
138  const uint8_t* data() const noexcept;
139  size_t data_len() const noexcept;
140  const rdm::Response& rdm() const noexcept;
141 
142  bool IsValid() const noexcept;
143  bool OriginalCommandIncluded() const noexcept;
144  bool HasData() const noexcept;
145  bool IsFromDefaultResponder() const noexcept;
146  bool IsResponseToMe() const noexcept;
147 
148  bool IsAck() const noexcept;
149  bool IsNack() const noexcept;
150 
151  bool IsGetResponse() const noexcept;
152  bool IsSetResponse() const noexcept;
153 
154  etcpal::Expected<rdm::NackReason> GetNackReason() const noexcept;
155  std::vector<uint8_t> GetData() const;
156 
157  void AppendData(const RdmResponse& new_resp);
158  void AppendData(const uint8_t* data, size_t size);
159 
160 private:
161  rdm::Uid rdmnet_source_uid_;
162  uint16_t source_endpoint_{0};
163  uint32_t seq_num_{0};
164  bool is_response_to_me_{false};
165  rdm::Command original_cmd_;
166  rdm::Response rdm_;
167 };
168 
170 // RdmResponse function definitions
172 
174 constexpr RdmResponse::RdmResponse(const RdmnetRdmResponse& c_resp) noexcept : resp_(c_resp)
175 {
176 }
177 
179 constexpr rdm::Uid RdmResponse::rdmnet_source_uid() const noexcept
180 {
181  return resp_.rdmnet_source_uid;
182 }
183 
185 constexpr uint16_t RdmResponse::source_endpoint() const noexcept
186 {
187  return resp_.source_endpoint;
188 }
189 
191 constexpr uint32_t RdmResponse::seq_num() const noexcept
192 {
193  return resp_.seq_num;
194 }
195 
199 constexpr rdm::Uid RdmResponse::original_cmd_source_uid() const noexcept
200 {
201  return (OriginalCommandIncluded() ? resp_.original_cmd_header.source_uid : rdm::Uid{});
202 }
203 
207 constexpr rdm::Uid RdmResponse::original_cmd_dest_uid() const noexcept
208 {
209  return (OriginalCommandIncluded() ? resp_.original_cmd_header.dest_uid : rdm::Uid{});
210 }
211 
215 constexpr rdm::CommandHeader RdmResponse::original_cmd_header() const noexcept
216 {
217  return (OriginalCommandIncluded() ? resp_.original_cmd_header : rdm::CommandHeader{});
218 }
219 
223 constexpr const uint8_t* RdmResponse::original_cmd_data() const noexcept
224 {
225  return (OriginalCommandIncluded() ? resp_.original_cmd_data : nullptr);
226 }
227 
231 constexpr uint8_t RdmResponse::original_cmd_data_len() const noexcept
232 {
233  return (OriginalCommandIncluded() ? resp_.original_cmd_data_len : 0);
234 }
235 
237 constexpr rdm::Uid RdmResponse::rdm_source_uid() const noexcept
238 {
239  return resp_.rdm_header.source_uid;
240 }
241 
243 constexpr rdm::Uid RdmResponse::rdm_dest_uid() const noexcept
244 {
245  return resp_.rdm_header.dest_uid;
246 }
247 
249 constexpr rdm_response_type_t RdmResponse::response_type() const noexcept
250 {
251  return resp_.rdm_header.resp_type;
252 }
253 
255 constexpr uint16_t RdmResponse::subdevice() const noexcept
256 {
257  return resp_.rdm_header.subdevice;
258 }
259 
261 constexpr rdm_command_class_t RdmResponse::command_class() const noexcept
262 {
263  return resp_.rdm_header.command_class;
264 }
265 
267 constexpr uint16_t RdmResponse::param_id() const noexcept
268 {
269  return resp_.rdm_header.param_id;
270 }
271 
273 constexpr rdm::ResponseHeader RdmResponse::rdm_header() const noexcept
274 {
275  return resp_.rdm_header;
276 }
277 
279 constexpr const uint8_t* RdmResponse::data() const noexcept
280 {
281  return resp_.rdm_data;
282 }
283 
285 constexpr size_t RdmResponse::data_len() const noexcept
286 {
287  return resp_.rdm_data_len;
288 }
289 
296 constexpr bool RdmResponse::more_coming() const noexcept
297 {
298  return resp_.more_coming;
299 }
300 
306 constexpr bool RdmResponse::OriginalCommandIncluded() const noexcept
307 {
308  return (resp_.seq_num != 0);
309 }
310 
312 constexpr bool RdmResponse::HasData() const noexcept
313 {
314  return (data_len() != 0);
315 }
316 
319 constexpr bool RdmResponse::IsFromDefaultResponder() const noexcept
320 {
321  return (resp_.source_endpoint == E133_NULL_ENDPOINT);
322 }
323 
326 constexpr bool RdmResponse::IsResponseToMe() const noexcept
327 {
328  return resp_.is_response_to_me;
329 }
330 
335 constexpr bool RdmResponse::IsAck() const noexcept
336 {
337  return (resp_.rdm_header.resp_type == kRdmResponseTypeAck);
338 }
339 
344 constexpr bool RdmResponse::IsNack() const noexcept
345 {
346  return (resp_.rdm_header.resp_type == kRdmResponseTypeNackReason);
347 }
348 
350 constexpr bool RdmResponse::IsGetResponse() const noexcept
351 {
352  return (resp_.rdm_header.command_class == kRdmCCGetCommandResponse);
353 }
354 
356 constexpr bool RdmResponse::IsSetResponse() const noexcept
357 {
358  return (resp_.rdm_header.command_class == kRdmCCSetCommandResponse);
359 }
360 
365 {
366  if (IsNack() && data_len() >= 2)
367  return etcpal_unpack_u16b(data());
368  else
369  return kEtcPalErrInvalid;
370 }
371 
375 {
376  return std::vector<uint8_t>(resp_.rdm_data, resp_.rdm_data + resp_.rdm_data_len);
377 }
378 
383 {
385 }
386 
388 constexpr const RdmnetRdmResponse& RdmResponse::get() const noexcept
389 {
390  return resp_;
391 }
392 
396 inline rdm::Command RdmResponse::OriginalCommandToRdm() const
397 {
398  return (OriginalCommandIncluded()
399  ? rdm::Command(resp_.original_cmd_header, resp_.original_cmd_data, resp_.original_cmd_data_len)
400  : rdm::Command{});
401 }
402 
404 inline rdm::Response RdmResponse::ToRdm() const
405 {
406  return rdm::Response(resp_.rdm_header, resp_.rdm_data, resp_.rdm_data_len);
407 }
408 
412 {
413  return SavedRdmResponse(*this);
414 }
415 
417 // SavedRdmResponse function definitions
419 
422  : rdmnet_source_uid_(c_resp.rdmnet_source_uid)
423  , source_endpoint_(c_resp.source_endpoint)
424  , seq_num_(c_resp.seq_num)
425  , original_cmd_(c_resp.original_cmd_header, c_resp.original_cmd_data, c_resp.original_cmd_data_len)
426  , rdm_(c_resp.rdm_header, c_resp.rdm_data, c_resp.rdm_data_len)
427 {
428 }
429 
432 {
433  rdmnet_source_uid_ = c_resp.rdmnet_source_uid;
434  source_endpoint_ = c_resp.source_endpoint;
435  seq_num_ = c_resp.seq_num;
436  original_cmd_ = rdm::Command(c_resp.original_cmd_header, c_resp.original_cmd_data, c_resp.original_cmd_data_len);
437  rdm_ = rdm::Response(c_resp.rdm_header, c_resp.rdm_data, c_resp.rdm_data_len);
438  return *this;
439 }
440 
443  : rdmnet_source_uid_(resp.rdmnet_source_uid())
444  , source_endpoint_(resp.source_endpoint())
445  , seq_num_(resp.seq_num())
446  , original_cmd_(resp.OriginalCommandToRdm())
447  , rdm_(resp.ToRdm())
448 {
449 }
450 
453 {
454  rdmnet_source_uid_ = resp.rdmnet_source_uid();
455  source_endpoint_ = resp.source_endpoint();
456  seq_num_ = resp.seq_num();
457  original_cmd_ = resp.OriginalCommandToRdm();
458  rdm_ = resp.ToRdm();
459  return *this;
460 }
461 
463 inline const rdm::Uid& SavedRdmResponse::rdmnet_source_uid() const noexcept
464 {
465  return rdmnet_source_uid_;
466 }
467 
469 inline uint16_t SavedRdmResponse::source_endpoint() const noexcept
470 {
471  return source_endpoint_;
472 }
473 
475 inline uint32_t SavedRdmResponse::seq_num() const noexcept
476 {
477  return seq_num_;
478 }
479 
483 inline rdm::Uid SavedRdmResponse::original_cmd_source_uid() const noexcept
484 {
485  return (OriginalCommandIncluded() ? original_cmd_.source_uid() : rdm::Uid{});
486 }
487 
491 inline rdm::Uid SavedRdmResponse::original_cmd_dest_uid() const noexcept
492 {
493  return (OriginalCommandIncluded() ? original_cmd_.dest_uid() : rdm::Uid{});
494 }
495 
499 inline const rdm::CommandHeader& SavedRdmResponse::original_cmd_header() const noexcept
500 {
501  return original_cmd_.header();
502 }
503 
507 inline const uint8_t* SavedRdmResponse::original_cmd_data() const noexcept
508 {
509  return (OriginalCommandIncluded() ? original_cmd_.data() : nullptr);
510 }
511 
515 inline uint8_t SavedRdmResponse::original_cmd_data_len() const noexcept
516 {
517  return (OriginalCommandIncluded() ? original_cmd_.data_len() : 0);
518 }
519 
523 inline const rdm::Command& SavedRdmResponse::original_cmd() const noexcept
524 {
525  return original_cmd_;
526 }
527 
529 inline rdm::Uid SavedRdmResponse::rdm_source_uid() const noexcept
530 {
531  return rdm_.source_uid();
532 }
533 
535 inline rdm::Uid SavedRdmResponse::rdm_dest_uid() const noexcept
536 {
537  return rdm_.dest_uid();
538 }
539 
541 inline rdm_response_type_t SavedRdmResponse::response_type() const noexcept
542 {
543  return rdm_.response_type();
544 }
545 
547 inline uint16_t SavedRdmResponse::subdevice() const noexcept
548 {
549  return rdm_.subdevice();
550 }
551 
553 inline rdm_command_class_t SavedRdmResponse::command_class() const noexcept
554 {
555  return rdm_.command_class();
556 }
557 
559 inline uint16_t SavedRdmResponse::param_id() const noexcept
560 {
561  return rdm_.param_id();
562 }
563 
565 inline const rdm::ResponseHeader& SavedRdmResponse::rdm_header() const noexcept
566 {
567  return rdm_.header();
568 }
569 
571 inline const uint8_t* SavedRdmResponse::data() const noexcept
572 {
573  return rdm_.data();
574 }
575 
577 inline size_t SavedRdmResponse::data_len() const noexcept
578 {
579  return rdm_.data_len();
580 }
581 
583 inline const rdm::Response& SavedRdmResponse::rdm() const noexcept
584 {
585  return rdm_;
586 }
587 
590 inline bool SavedRdmResponse::IsValid() const noexcept
591 {
592  return rdm_.IsValid();
593 }
594 
600 inline bool SavedRdmResponse::OriginalCommandIncluded() const noexcept
601 {
602  return (seq_num_ != 0);
603 }
604 
606 inline bool SavedRdmResponse::HasData() const noexcept
607 {
608  return rdm_.HasData();
609 }
610 
613 inline bool SavedRdmResponse::IsFromDefaultResponder() const noexcept
614 {
615  return (source_endpoint_ == E133_NULL_ENDPOINT);
616 }
617 
620 inline bool SavedRdmResponse::IsResponseToMe() const noexcept
621 {
622  return is_response_to_me_;
623 }
624 
629 inline bool SavedRdmResponse::IsAck() const noexcept
630 {
631  return rdm_.IsAck();
632 }
633 
638 inline bool SavedRdmResponse::IsNack() const noexcept
639 {
640  return rdm_.IsNack();
641 }
642 
644 inline bool SavedRdmResponse::IsGetResponse() const noexcept
645 {
646  return rdm_.IsGetResponse();
647 }
648 
650 inline bool SavedRdmResponse::IsSetResponse() const noexcept
651 {
652  return rdm_.IsSetResponse();
653 }
654 
659 {
660  return rdm_.GetNackReason();
661 }
662 
666 {
667  return rdm_.GetData();
668 }
669 
672 inline void SavedRdmResponse::AppendData(const RdmResponse& new_resp)
673 {
674  rdm_.AppendData(new_resp.data(), new_resp.data_len());
675 }
676 
680 inline void SavedRdmResponse::AppendData(const uint8_t* data, size_t data_len)
681 {
682  rdm_.AppendData(data, data_len);
683 }
684 }; // namespace rdmnet
685 
686 #endif // RDMNET_CPP_MESSAGE_TYPES_RDM_RESPONSE_H_
An RDM response received over RDMnet and delivered to an RDMnet callback function.
Definition: rdm_response.h:47
RdmResponse(const RdmResponse &other)=delete
Not copyable - use Save() to create a copyable version.
constexpr rdm::Uid rdm_dest_uid() const noexcept
Get the UID of the RDM controller to which this response is addressed.
Definition: rdm_response.h:243
constexpr bool IsResponseToMe() const noexcept
Whether the response was sent in response to a command previously sent by this controller.
Definition: rdm_response.h:326
constexpr rdm::ResponseHeader rdm_header() const noexcept
Get the RDM protocol header contained within this response.
Definition: rdm_response.h:273
constexpr const RdmnetRdmResponse & get() const noexcept
Get a const reference to the underlying C type.
Definition: rdm_response.h:388
constexpr bool IsSetResponse() const noexcept
Whether this response is an RDM SET response.
Definition: rdm_response.h:356
constexpr const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this response.
Definition: rdm_response.h:279
constexpr bool IsAck() const noexcept
Whether this command has an RDM response type of ACK.
Definition: rdm_response.h:335
constexpr uint8_t original_cmd_data_len() const noexcept
Get the length of the RDM parameter data accompanying the original RDM command, if available.
Definition: rdm_response.h:231
RdmResponse()=delete
Not default-constructible.
constexpr rdm_command_class_t command_class() const noexcept
Get the RDM response class of this response.
Definition: rdm_response.h:261
constexpr rdm::CommandHeader original_cmd_header() const noexcept
Get the RDM protocol header of the original RDM command, if available.
Definition: rdm_response.h:215
constexpr bool more_coming() const noexcept
This message contains partial RDM data.
Definition: rdm_response.h:296
constexpr bool IsNack() const noexcept
Whether this command has an RDM response type of NACK_REASON.
Definition: rdm_response.h:344
constexpr rdm_response_type_t response_type() const noexcept
Get the RDM response type of this response.
Definition: rdm_response.h:249
std::vector< uint8_t > GetOriginalCmdData() const
Copy out the original RDM command data in a RdmResponse.
Definition: rdm_response.h:382
constexpr rdm::Uid rdm_source_uid() const noexcept
Get the UID of the RDM responder that sent this response.
Definition: rdm_response.h:237
SavedRdmResponse Save() const
Save the data in this response for later use from a different context.
Definition: rdm_response.h:411
constexpr rdm::Uid rdmnet_source_uid() const noexcept
Get the UID of the RDMnet component that sent this response.
Definition: rdm_response.h:179
constexpr rdm::Uid original_cmd_source_uid() const noexcept
Get the RDM source UID of the original RDM command, if available.
Definition: rdm_response.h:199
constexpr uint32_t seq_num() const noexcept
Get the RDMnet sequence number of this response, for matching with a corresponding command.
Definition: rdm_response.h:191
constexpr bool IsGetResponse() const noexcept
Whether this response is an RDM GET response.
Definition: rdm_response.h:350
constexpr const uint8_t * original_cmd_data() const noexcept
Get the RDM parameter data of the original RDM command, if available.
Definition: rdm_response.h:223
rdm::Response ToRdm() const
Convert the RDM data in this response to an RDM response type.
Definition: rdm_response.h:404
constexpr bool HasData() const noexcept
Whether this RDM response includes any RDM parameter data.
Definition: rdm_response.h:312
RdmResponse & operator=(const RdmResponse &other)=delete
Not copyable - use Save() to create a copyable version.
constexpr uint16_t source_endpoint() const noexcept
Get the endpoint from which this response was sent.
Definition: rdm_response.h:185
std::vector< uint8_t > GetData() const
Copy out the data in a RdmResponse.
Definition: rdm_response.h:374
constexpr rdm::Uid original_cmd_dest_uid() const noexcept
Get the RDM destination UID of the original RDM command, if available.
Definition: rdm_response.h:207
constexpr bool IsFromDefaultResponder() const noexcept
Whether this RDM response is from a default responder.
Definition: rdm_response.h:319
constexpr bool OriginalCommandIncluded() const noexcept
Whether the original RDM command is included.
Definition: rdm_response.h:306
constexpr uint16_t subdevice() const noexcept
Get the RDM subdevice from which this response originated (0 means the root device).
Definition: rdm_response.h:255
etcpal::Expected< rdm::NackReason > GetNackReason() const noexcept
Get the NACK reason code of this RDM response.
Definition: rdm_response.h:364
rdm::Command OriginalCommandToRdm() const
Convert the original RDM command associated with this response to an RDM command type.
Definition: rdm_response.h:396
constexpr size_t data_len() const noexcept
Get the length of the RDM parameter data contained within this response.
Definition: rdm_response.h:285
constexpr uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this response.
Definition: rdm_response.h:267
An RDM response received over RDMnet and saved for later processing.
Definition: rdm_response.h:111
SavedRdmResponse & operator=(const RdmnetSavedRdmResponse &c_resp)
Assign an instance of the C RdmnetSavedRdmResponse type to an instance of this class.
Definition: rdm_response.h:431
bool OriginalCommandIncluded() const noexcept
Whether the original RDM command is included.
Definition: rdm_response.h:600
rdm::Uid rdm_dest_uid() const noexcept
Get the UID of the RDM controller to which this response is addressed.
Definition: rdm_response.h:535
bool IsSetResponse() const noexcept
Whether this response is an RDM SET response.
Definition: rdm_response.h:650
size_t data_len() const noexcept
Get the length of the RDM parameter data contained within this response.
Definition: rdm_response.h:577
std::vector< uint8_t > GetData() const
Copy out the data in a SavedRdmResponse.
Definition: rdm_response.h:665
uint16_t source_endpoint() const noexcept
Get the endpoint from which this response was sent.
Definition: rdm_response.h:469
const uint8_t * original_cmd_data() const noexcept
Get the RDM parameter data of the original RDM command, if available.
Definition: rdm_response.h:507
const rdm::Response & rdm() const noexcept
Get the RDM data in this response as an RDM response type.
Definition: rdm_response.h:583
bool IsValid() const noexcept
Whether the values contained in this response are valid for an RDM response.
Definition: rdm_response.h:590
uint8_t original_cmd_data_len() const noexcept
Get the length of the RDM parameter data accompanying the original RDM command, if available.
Definition: rdm_response.h:515
rdm::Uid rdm_source_uid() const noexcept
Get the UID of the RDM responder that sent this response.
Definition: rdm_response.h:529
const rdm::CommandHeader & original_cmd_header() const noexcept
Get the RDM protocol header of the original RDM command, if available.
Definition: rdm_response.h:499
bool IsFromDefaultResponder() const noexcept
Whether this RDM response is from a default responder.
Definition: rdm_response.h:613
void AppendData(const RdmResponse &new_resp)
Append more data to this response's parameter data.
Definition: rdm_response.h:672
bool IsNack() const noexcept
Whether this command has an RDM response type of NACK_REASON.
Definition: rdm_response.h:638
bool IsResponseToMe() const noexcept
Whether the response was sent in response to a command previously sent by this controller.
Definition: rdm_response.h:620
bool IsAck() const noexcept
Whether this command has an RDM response type of ACK.
Definition: rdm_response.h:629
const rdm::Command & original_cmd() const noexcept
Get the original RDM command that resulted in this RDM response, if available.
Definition: rdm_response.h:523
const rdm::ResponseHeader & rdm_header() const noexcept
Get the RDM protocol header contained within this response.
Definition: rdm_response.h:565
rdm::Uid original_cmd_source_uid() const noexcept
Get the RDM source UID of the original RDM command, if available.
Definition: rdm_response.h:483
bool IsGetResponse() const noexcept
Whether this response is an RDM GET response.
Definition: rdm_response.h:644
uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this response.
Definition: rdm_response.h:559
rdm_response_type_t response_type() const noexcept
Get the RDM response type of this response.
Definition: rdm_response.h:541
bool HasData() const noexcept
Whether this RDM response includes any RDM parameter data.
Definition: rdm_response.h:606
uint32_t seq_num() const noexcept
Get the RDMnet sequence number of this response, for matching with a corresponding command.
Definition: rdm_response.h:475
rdm_command_class_t command_class() const noexcept
Get the RDM response class of this response.
Definition: rdm_response.h:553
SavedRdmResponse()=default
Constructs an empty, invalid RDM response by default.
etcpal::Expected< rdm::NackReason > GetNackReason() const noexcept
Get the NACK reason code of this RDM response.
Definition: rdm_response.h:658
uint16_t subdevice() const noexcept
Get the RDM subdevice from which this response originated (0 means the root device).
Definition: rdm_response.h:547
const rdm::Uid & rdmnet_source_uid() const noexcept
Get the UID of the RDMnet component that sent this response.
Definition: rdm_response.h:463
rdm::Uid original_cmd_dest_uid() const noexcept
Get the RDM destination UID of the original RDM command, if available.
Definition: rdm_response.h:491
const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this response.
Definition: rdm_response.h:571
kEtcPalErrInvalid
uint16_t etcpal_unpack_u16b(const uint8_t *buf)
Basic types for parsed RDMnet messages.
A namespace which contains all C++ language definitions in the RDMnet library.
Definition: broker.h:45
An RDMnet RDM response received by a local component.
Definition: message.h:90
RdmCommandHeader original_cmd_header
The header of the original command associated with this response; valid if seq_num !...
Definition: message.h:104
uint8_t original_cmd_data_len
The length of the parameter data associated with the original RDM command; valid if seq_num !...
Definition: message.h:111
const uint8_t * original_cmd_data
Any parameter data associated with the original RDM command; valid if seq_num != 0.
Definition: message.h:106
size_t rdm_data_len
The length of the parameter data associated with the RDM response.
Definition: message.h:118
RdmUid rdmnet_source_uid
The UID of the RDMnet component that sent this response.
Definition: message.h:92
uint16_t source_endpoint
The endpoint from which the response was sent.
Definition: message.h:94
bool is_response_to_me
Whether the response was sent in response to a command previously sent by this controller.
Definition: message.h:101
RdmResponseHeader rdm_header
The header information from the encapsulated RDM response.
Definition: message.h:114
const uint8_t * rdm_data
Any parameter data associated with the RDM response.
Definition: message.h:116
bool more_coming
This message contains partial RDM data.
Definition: message.h:127
uint32_t seq_num
The sequence number of the response, for matching with a corresponding command.
Definition: message.h:96
An RDM response received over RDMnet and saved for later processing.
Definition: message.h:138
uint8_t * rdm_data
Any parameter data associated with the RDM response.
Definition: message.h:167
RdmResponseHeader rdm_header
The header information from the encapsulated RDM response.
Definition: message.h:162
RdmUid rdmnet_source_uid
The UID of the RDMnet component that sent this response.
Definition: message.h:140
uint16_t source_endpoint
The endpoint from which the response was sent.
Definition: message.h:142
size_t rdm_data_len
The length of the parameter data associated with the RDM response.
Definition: message.h:169
uint32_t seq_num
The sequence number of the response, for matching with a corresponding command.
Definition: message.h:144
uint8_t original_cmd_data[RDM_MAX_PDL]
Any parameter data associated with the original RDM command; valid if seq_num != 0.
Definition: message.h:154
RdmCommandHeader original_cmd_header
The header of the original command associated with this response; valid if seq_num !...
Definition: message.h:152
uint8_t original_cmd_data_len
The length of the parameter data associated with the original RDM command; valid if seq_num !...
Definition: message.h:159