Open Lighting Architecture: include/ola/rdm/RDMCommand.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
RDMCommand.h
Go to the documentation of this file.
1/*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * RDMCommand.h
17 * All the classes that represent RDM commands.
18 * Copyright (C) 2005 Simon Newton
19 */
20
21
29
30#ifndef INCLUDE_OLA_RDM_RDMCOMMAND_H_
31#define INCLUDE_OLA_RDM_RDMCOMMAND_H_
32
33#include <stdint.h>
34#include <ola/base/Macro.h>
35#include <ola/io/ByteString.h>
36#include <ola/io/OutputStream.h>
37#include <ola/rdm/CommandPrinter.h>
38#include <ola/rdm/RDMEnums.h>
39#include <ola/rdm/RDMPacket.h>
40#include <ola/rdm/RDMResponseCodes.h>
41#include <ola/rdm/UID.h>
42#include <sstream>
43#include <string>
44
45namespace ola {
46namespace rdm {
47
52
59 class RDMCommand {
60 public:
65 // TODO(simon): remove this in favor of the new one in RDMEnums.h
66 typedef enum {
67 DISCOVER_COMMAND = 0x10,
68 DISCOVER_COMMAND_RESPONSE = 0x11,
69 GET_COMMAND = 0x20,
70 GET_COMMAND_RESPONSE = 0x21,
71 SET_COMMAND = 0x30,
72 SET_COMMAND_RESPONSE = 0x31,
73 INVALID_COMMAND = 0xff,
74 } RDMCommandClass;
75
76 virtual ~RDMCommand();
77
82
89 std::string ToString() const;
90
97 friend std::ostream& operator<<(std::ostream &out,
98 const RDMCommand &command) {
99 return out << command.ToString();
100 }
101
103
108
110 virtual uint8_t SubStartCode() const { return SUB_START_CODE; }
111
113 virtual uint8_t MessageLength() const;
114
116 const UID& SourceUID() const { return m_source; }
117
119 const UID& DestinationUID() const { return m_destination; }
120
122 uint8_t TransactionNumber() const { return m_transaction_number; }
123
125 uint8_t PortIdResponseType() const { return m_port_id; }
126
128 uint8_t MessageCount() const { return m_message_count; }
129
131 uint16_t SubDevice() const { return m_sub_device; }
132
134 virtual RDMCommandClass CommandClass() const = 0;
135
137 uint16_t ParamId() const { return m_param_id; }
138
140 unsigned int ParamDataSize() const { return m_data_length; }
141
143 const uint8_t *ParamData() const { return m_data; }
144
146
154 virtual uint16_t Checksum(uint16_t checksum) const { return checksum; }
155
163 virtual void Print(CommandPrinter *printer,
164 bool summarize,
165 bool unpack_param_data) const {
166 printer->Print(this, summarize, unpack_param_data);
167 }
168
174 bool operator==(const RDMCommand &other) const;
175
179 static const uint8_t START_CODE = 0xcc;
180
187 static RDMCommand *Inflate(const uint8_t *data, unsigned int length);
188
189 protected:
190 uint8_t m_port_id;
191 UID m_source;
192 UID m_destination;
193 uint8_t m_transaction_number;
194
198 RDMCommand(const UID &source,
199 const UID &destination,
200 uint8_t transaction_number,
201 uint8_t port_id,
202 uint8_t message_count,
203 uint16_t sub_device,
204 uint16_t param_id,
205 const uint8_t *data,
206 unsigned int length);
207
208 void SetParamData(const uint8_t *data, unsigned int length);
209
210 static RDMStatusCode VerifyData(const uint8_t *data,
211 size_t length,
212 RDMCommandHeader *command_message);
213
214 static RDMCommandClass ConvertCommandClass(uint8_t command_type);
215
216 private:
217 uint8_t m_message_count;
218 uint16_t m_sub_device;
219 uint16_t m_param_id;
220 uint8_t *m_data;
221 unsigned int m_data_length;
222
223 static uint16_t CalculateChecksum(const uint8_t *data,
224 unsigned int packet_length);
225
226 RDMCommand(const RDMCommand &) = delete;
227 const RDMCommand &operator=(const RDMCommand &) = delete;
228};
229
230
234 class RDMRequest: public RDMCommand {
235 public:
236 struct OverrideOptions {
237 public:
242 OverrideOptions()
243 : has_message_length(false),
244 has_checksum(false),
245 sub_start_code(SUB_START_CODE),
246 message_length(0),
247 message_count(0),
248 checksum(0) {
249 }
250
251 void SetMessageLength(uint8_t message_length_arg) {
252 has_message_length = true;
253 message_length = message_length_arg;
254 }
255
256 void SetChecksum(uint16_t checksum_arg) {
257 has_checksum = true;
258 checksum = checksum_arg;
259 }
260
261 bool has_message_length;
262 bool has_checksum;
263
264 uint8_t sub_start_code;
265 uint8_t message_length;
266 uint8_t message_count;
267 uint16_t checksum;
268 };
269
283 RDMRequest(const UID &source,
284 const UID &destination,
285 uint8_t transaction_number,
286 uint8_t port_id,
287 uint16_t sub_device,
288 RDMCommandClass command_class,
289 uint16_t param_id,
290 const uint8_t *data,
291 unsigned int length,
292 const OverrideOptions &options = OverrideOptions());
293
294 RDMCommandClass CommandClass() const { return m_command_class; }
295
300 uint8_t PortId() const { return m_port_id; }
301
306 virtual RDMRequest *Duplicate() const {
307 return new RDMRequest(
308 SourceUID(),
309 DestinationUID(),
310 TransactionNumber(),
311 PortId(),
312 SubDevice(),
313 m_command_class,
314 ParamId(),
315 ParamData(),
316 ParamDataSize(),
317 m_override_options);
318 }
319
320 virtual void Print(CommandPrinter *printer,
321 bool summarize,
322 bool unpack_param_data) const {
323 printer->Print(this, summarize, unpack_param_data);
324 }
325
330 bool IsDUB() const;
331
332 uint8_t SubStartCode() const;
333 uint8_t MessageLength() const;
334 uint16_t Checksum(uint16_t checksum) const;
335
340
345 void SetSourceUID(const UID &source_uid) {
346 m_source = source_uid;
347 }
348
353 void SetTransactionNumber(uint8_t transaction_number) {
354 m_transaction_number = transaction_number;
355 }
356
361 void SetPortId(uint8_t port_id) {
362 m_port_id = port_id;
363 }
364
366
373 static RDMRequest* InflateFromData(const uint8_t *data,
374 unsigned int length);
375
376 protected:
377 OverrideOptions m_override_options;
378
379 private:
380 RDMCommandClass m_command_class;
381};
382
383
387 class RDMGetSetRequest: public RDMRequest {
388 public:
402 RDMGetSetRequest(const UID &source,
403 const UID &destination,
404 uint8_t transaction_number,
405 uint8_t port_id,
406 uint16_t sub_device,
407 RDMCommandClass command_class,
408 uint16_t param_id,
409 const uint8_t *data,
410 unsigned int length,
411 const OverrideOptions &options)
412 : RDMRequest(source, destination, transaction_number, port_id,
413 sub_device, command_class, param_id, data, length, options) {
414 }
415};
416
417
418template <RDMCommand::RDMCommandClass command_class>
419 class BaseRDMRequest: public RDMGetSetRequest {
420 public:
421 BaseRDMRequest(const UID &source,
422 const UID &destination,
423 uint8_t transaction_number,
424 uint8_t port_id,
425 uint16_t sub_device,
426 uint16_t param_id,
427 const uint8_t *data,
428 unsigned int length,
429 const OverrideOptions &options = OverrideOptions())
430 : RDMGetSetRequest(source, destination, transaction_number, port_id,
431 sub_device, command_class, param_id, data, length,
432 options) {
433 }
434
435 BaseRDMRequest<command_class> *Duplicate() const {
436 return new BaseRDMRequest<command_class>(
437 SourceUID(),
438 DestinationUID(),
439 TransactionNumber(),
440 PortId(),
441 SubDevice(),
442 ParamId(),
443 ParamData(),
444 ParamDataSize(),
445 m_override_options);
446 }
447};
448
449typedef BaseRDMRequest<RDMCommand::GET_COMMAND> RDMGetRequest;
450typedef BaseRDMRequest<RDMCommand::SET_COMMAND> RDMSetRequest;
451
452
457 class RDMResponse: public RDMCommand {
458 public:
472 RDMResponse(const UID &source,
473 const UID &destination,
474 uint8_t transaction_number,
475 uint8_t response_type,
476 uint8_t message_count,
477 uint16_t sub_device,
478 RDMCommand::RDMCommandClass command_class,
479 uint16_t param_id,
480 const uint8_t *data,
481 unsigned int length)
482 : RDMCommand(source, destination, transaction_number, response_type,
483 message_count, sub_device, param_id, data, length),
484 m_command_class(command_class) {
485 }
486
487 virtual void Print(CommandPrinter *printer,
488 bool summarize,
489 bool unpack_param_data) const {
490 printer->Print(this, summarize, unpack_param_data);
491 }
492
497 RDMResponse *Duplicate() const {
498 return new RDMResponse(
499 SourceUID(),
500 DestinationUID(),
501 TransactionNumber(),
502 ResponseType(),
503 MessageCount(),
504 SubDevice(),
505 CommandClass(),
506 ParamId(),
507 ParamData(),
508 ParamDataSize());
509 }
510
515
520 uint8_t ResponseType() const { return m_port_id; }
521
522 RDMCommandClass CommandClass() const { return m_command_class; }
523
525
530
535 void SetDestinationUID(const UID &destination_uid) {
536 m_destination = destination_uid;
537 }
538
543 void SetTransactionNumber(uint8_t transaction_number) {
544 m_transaction_number = transaction_number;
545 }
546
548
554 static const unsigned int MAX_OVERFLOW_SIZE = 4 << 10;
555
564 static RDMResponse* InflateFromData(const uint8_t *data,
565 size_t length,
566 RDMStatusCode *status_code,
567 const RDMRequest *request = NULL);
568
576 static RDMResponse* InflateFromData(const ola::io::ByteString &input,
577 RDMStatusCode *status_code,
578 const RDMRequest *request = NULL) {
579 return InflateFromData(input.data(), input.size(), status_code, request);
580 }
581
592 static RDMResponse* CombineResponses(const RDMResponse *response1,
593 const RDMResponse *response2);
594
595 private:
596 RDMCommand::RDMCommandClass m_command_class;
597};
598
599
603 class RDMGetSetResponse: public RDMResponse {
604 public:
605 RDMGetSetResponse(const UID &source,
606 const UID &destination,
607 uint8_t transaction_number,
608 uint8_t response_type,
609 uint8_t message_count,
610 uint16_t sub_device,
611 RDMCommand::RDMCommandClass command_class,
612 uint16_t param_id,
613 const uint8_t *data,
614 unsigned int length)
615 : RDMResponse(source, destination, transaction_number, response_type,
616 message_count, sub_device, command_class, param_id, data,
617 length) {
618 }
619};
620
621
622template <RDMCommand::RDMCommandClass command_class>
623 class BaseRDMResponse: public RDMGetSetResponse {
624 public:
625 BaseRDMResponse(const UID &source,
626 const UID &destination,
627 uint8_t transaction_number,
628 uint8_t response_type,
629 uint8_t message_count,
630 uint16_t sub_device,
631 uint16_t param_id,
632 const uint8_t *data,
633 unsigned int length)
634 : RDMGetSetResponse(source, destination, transaction_number,
635 response_type, message_count, sub_device,
636 command_class, param_id, data, length) {
637 }
638};
639
640typedef BaseRDMResponse<RDMCommand::GET_COMMAND_RESPONSE> RDMGetResponse;
641typedef BaseRDMResponse<RDMCommand::SET_COMMAND_RESPONSE> RDMSetResponse;
642
643// Helper functions for dealing with RDMCommands
644// These are mostly used with the RDM-TRI & dummy plugin
645
649 RDMResponse *NackWithReason(const RDMRequest *request,
650 rdm_nack_reason reason,
651 uint8_t outstanding_messages = 0);
655 RDMResponse *GetResponseFromData(const RDMRequest *request,
656 const uint8_t *data = NULL,
657 unsigned int length = 0,
658 rdm_response_type type = RDM_ACK,
659 uint8_t outstanding_messages = 0);
660
664 RDMResponse *GetResponseWithPid(const RDMRequest *request,
665 uint16_t pid,
666 const uint8_t *data,
667 unsigned int length,
668 uint8_t type = RDM_ACK,
669 uint8_t outstanding_messages = 0);
670
674 class RDMDiscoveryRequest: public RDMRequest {
675 public:
676 RDMDiscoveryRequest(const UID &source,
677 const UID &destination,
678 uint8_t transaction_number,
679 uint8_t port_id,
680 uint16_t sub_device,
681 uint16_t param_id,
682 const uint8_t *data,
683 unsigned int length,
684 const OverrideOptions &options = OverrideOptions())
685 : RDMRequest(source,
686 destination,
687 transaction_number,
688 port_id,
689 sub_device,
690 DISCOVER_COMMAND,
691 param_id,
692 data,
693 length,
694 options) {
695 }
696
697 uint8_t PortId() const { return m_port_id; }
698
699 virtual void Print(CommandPrinter *printer,
700 bool summarize,
701 bool unpack_param_data) const {
702 printer->Print(this, summarize, unpack_param_data);
703 }
704
705 static RDMDiscoveryRequest* InflateFromData(const uint8_t *data,
706 unsigned int length);
707};
708
709
710// Because the number of discovery requests is small (3 type) we provide a
711// helper method for each here.
715RDMDiscoveryRequest *NewDiscoveryUniqueBranchRequest(
716 const UID &source,
717 const UID &lower,
718 const UID &upper,
719 uint8_t transaction_number,
720 uint8_t port_id = 1);
721
722
726RDMDiscoveryRequest *NewMuteRequest(const UID &source,
727 const UID &destination,
728 uint8_t transaction_number,
729 uint8_t port_id = 1);
730
734RDMDiscoveryRequest *NewUnMuteRequest(const UID &source,
735 const UID &destination,
736 uint8_t transaction_number,
737 uint8_t port_id = 1);
738
739
743 class RDMDiscoveryResponse: public RDMResponse {
744 public:
745 RDMDiscoveryResponse(const UID &source,
746 const UID &destination,
747 uint8_t transaction_number,
748 uint8_t port_id,
749 uint8_t message_count,
750 uint16_t sub_device,
751 uint16_t param_id,
752 const uint8_t *data,
753 unsigned int length)
754 : RDMResponse(source,
755 destination,
756 transaction_number,
757 port_id,
758 message_count,
759 sub_device,
760 DISCOVER_COMMAND_RESPONSE,
761 param_id,
762 data,
763 length) {
764 }
765
766 virtual void Print(CommandPrinter *printer,
767 bool summarize,
768 bool unpack_param_data) const {
769 printer->Print(this, summarize, unpack_param_data);
770 }
771
772 static RDMDiscoveryResponse* InflateFromData(const uint8_t *data,
773 unsigned int length);
774};
775
776} // namespace rdm
777} // namespace ola
778#endif // INCLUDE_OLA_RDM_RDMCOMMAND_H_
Macro.h
Helper macros.
RDMEnums.h
Various constants used in RDM.
RDMPacket.h
Structures and constants used with RDM Packets.
RDMResponseCodes.h
Enums representing the states of a response. This is generated from the proto file.
UID.h
A RDM unique identifier (UID).
ola::plugin::spi::RDMResponse::RDMResponse
RDMResponse(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t response_type, uint8_t message_count, uint16_t sub_device, RDMCommand::RDMCommandClass command_class, uint16_t param_id, const uint8_t *data, unsigned int length)
Create a new RDM Response.
Definition RDMCommand.h:472
ola::rdm::BaseRDMRequest::Duplicate
BaseRDMRequest< command_class > * Duplicate() const
Make a copy of the request.
Definition RDMCommand.h:435
ola::rdm::BaseRDMResponse
Definition RDMCommand.h:623
ola::rdm::CommandPrinter
Definition CommandPrinter.h:31
ola::rdm::RDMCommand
The base class that all RDM requests & responses inherit from.
Definition RDMCommand.h:59
ola::rdm::RDMCommand::SubDevice
uint16_t SubDevice() const
Returns the SubDevice of the RDMCommand.
Definition RDMCommand.h:131
ola::rdm::RDMCommand::TransactionNumber
uint8_t TransactionNumber() const
Returns the Transaction Number of the RDMCommand.
Definition RDMCommand.h:122
ola::rdm::RDMCommand::ParamDataSize
unsigned int ParamDataSize() const
Returns the Size of the Parameter Data of the RDMCommand.
Definition RDMCommand.h:140
ola::rdm::RDMCommand::START_CODE
static const uint8_t START_CODE
The RDM Start Code.
Definition RDMCommand.h:179
ola::rdm::RDMCommand::Print
virtual void Print(CommandPrinter *printer, bool summarize, bool unpack_param_data) const
Output the contents of the command to a CommandPrinter.
Definition RDMCommand.h:163
ola::rdm::RDMCommand::Checksum
virtual uint16_t Checksum(uint16_t checksum) const
Modify the calculated checksum for this command.
Definition RDMCommand.h:154
ola::rdm::RDMCommand::SourceUID
const UID & SourceUID() const
Returns the Source UID of the RDMCommand.
Definition RDMCommand.h:116
ola::rdm::RDMCommand::ParamId
uint16_t ParamId() const
Returns the Parameter ID of the RDMCommand.
Definition RDMCommand.h:137
ola::rdm::RDMCommand::ParamData
const uint8_t * ParamData() const
Returns the Parameter Data of the RDMCommand.
Definition RDMCommand.h:143
ola::rdm::RDMCommand::CommandClass
virtual RDMCommandClass CommandClass() const =0
The CommmandClass of this message.
ola::rdm::RDMCommand::MessageCount
uint8_t MessageCount() const
Returns the Message Count of the RDMCommand.
Definition RDMCommand.h:128
ola::rdm::RDMCommand::RDMCommandClass
RDMCommandClass
A set of values representing CommandClasses in E1.20.
Definition RDMCommand.h:66
ola::rdm::RDMCommand::GET_COMMAND
@ GET_COMMAND
Definition RDMCommand.h:69
ola::rdm::RDMCommand::GET_COMMAND_RESPONSE
@ GET_COMMAND_RESPONSE
Definition RDMCommand.h:70
ola::rdm::RDMCommand::INVALID_COMMAND
@ INVALID_COMMAND
Definition RDMCommand.h:73
ola::rdm::RDMCommand::SET_COMMAND
@ SET_COMMAND
Definition RDMCommand.h:71
ola::rdm::RDMCommand::DISCOVER_COMMAND
@ DISCOVER_COMMAND
Definition RDMCommand.h:67
ola::rdm::RDMCommand::DISCOVER_COMMAND_RESPONSE
@ DISCOVER_COMMAND_RESPONSE
Definition RDMCommand.h:68
ola::rdm::RDMCommand::SET_COMMAND_RESPONSE
@ SET_COMMAND_RESPONSE
Definition RDMCommand.h:72
ola::rdm::RDMCommand::DestinationUID
const UID & DestinationUID() const
Returns the Destination UID of the RDMCommand.
Definition RDMCommand.h:119
ola::rdm::RDMCommand::SubStartCode
virtual uint8_t SubStartCode() const
The Sub-Start code for the RDMCommand.
Definition RDMCommand.h:110
ola::rdm::RDMCommand::PortIdResponseType
uint8_t PortIdResponseType() const
Returns the Port ID of the RDMCommand.
Definition RDMCommand.h:125
ola::rdm::RDMDiscoveryRequest
An RDM request of type DISCOVER_COMMAND.
Definition RDMCommand.h:674
ola::rdm::RDMDiscoveryRequest::Print
virtual void Print(CommandPrinter *printer, bool summarize, bool unpack_param_data) const
Output the contents of the command to a CommandPrinter.
Definition RDMCommand.h:699
ola::rdm::RDMDiscoveryResponse
An RDM response of type DISCOVER_COMMAND.
Definition RDMCommand.h:743
ola::rdm::RDMDiscoveryResponse::Print
virtual void Print(CommandPrinter *printer, bool summarize, bool unpack_param_data) const
Output the contents of the command to a CommandPrinter.
Definition RDMCommand.h:766
ola::rdm::RDMGetSetRequest::RDMGetSetRequest
RDMGetSetRequest(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id, uint16_t sub_device, RDMCommandClass command_class, uint16_t param_id, const uint8_t *data, unsigned int length, const OverrideOptions &options)
Create a new Get / Set Request.
Definition RDMCommand.h:402
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::rdm::RDMRequest::SetSourceUID
void SetSourceUID(const UID &source_uid)
Set the source UID.
Definition RDMCommand.h:345
ola::rdm::RDMRequest::CommandClass
RDMCommandClass CommandClass() const
The CommmandClass of this message.
Definition RDMCommand.h:294
ola::rdm::RDMRequest::Print
virtual void Print(CommandPrinter *printer, bool summarize, bool unpack_param_data) const
Output the contents of the command to a CommandPrinter.
Definition RDMCommand.h:320
ola::rdm::RDMRequest::PortId
uint8_t PortId() const
The Port ID for this request.
Definition RDMCommand.h:300
ola::rdm::RDMRequest::SetPortId
void SetPortId(uint8_t port_id)
Set the Port Id.
Definition RDMCommand.h:361
ola::rdm::RDMRequest::SetTransactionNumber
void SetTransactionNumber(uint8_t transaction_number)
Set the transaction number.
Definition RDMCommand.h:353
ola::rdm::RDMRequest::Duplicate
virtual RDMRequest * Duplicate() const
Make a copy of the request.
Definition RDMCommand.h:306
ola::rdm::RDMResponse
An RDM Command that represents responses (GET, SET or DISCOVER).
Definition RDMCommand.h:457
ola::rdm::RDMResponse::SetTransactionNumber
void SetTransactionNumber(uint8_t transaction_number)
Set the transaction number.
Definition RDMCommand.h:543
ola::rdm::RDMResponse::CommandClass
RDMCommandClass CommandClass() const
The CommmandClass of this message.
Definition RDMCommand.h:522
ola::rdm::RDMResponse::ResponseType
uint8_t ResponseType() const
The Response Type.
Definition RDMCommand.h:520
ola::rdm::RDMResponse::SetDestinationUID
void SetDestinationUID(const UID &destination_uid)
Set the destination UID.
Definition RDMCommand.h:535
ola::rdm::RDMResponse::Print
virtual void Print(CommandPrinter *printer, bool summarize, bool unpack_param_data) const
Output the contents of the command to a CommandPrinter.
Definition RDMCommand.h:487
ola::rdm::RDMResponse::InflateFromData
static RDMResponse * InflateFromData(const ola::io::ByteString &input, RDMStatusCode *status_code, const RDMRequest *request=NULL)
Definition RDMCommand.h:576
ola::rdm::RDMResponse::MAX_OVERFLOW_SIZE
static const unsigned int MAX_OVERFLOW_SIZE
The maximum size of an ACK_OVERFLOW session that we'll buffer.
Definition RDMCommand.h:554
ola::rdm::RDMResponse::RDMResponse
RDMResponse(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t response_type, uint8_t message_count, uint16_t sub_device, RDMCommand::RDMCommandClass command_class, uint16_t param_id, const uint8_t *data, unsigned int length)
Create a new RDM Response.
Definition RDMCommand.h:472
ola::rdm::RDMResponse::Duplicate
RDMResponse * Duplicate() const
Make a copy of the response.
Definition RDMCommand.h:497
ola::rdm::UID
Represents a RDM UID.
Definition UID.h:57
ola::rdm::RDMCommand::Inflate
static RDMCommand * Inflate(const uint8_t *data, unsigned int length)
Extract a RDMCommand from raw data.
Definition RDMCommand.cpp:141
ola::rdm::RDMRequest::MessageLength
uint8_t MessageLength() const
The Message length field.
Definition RDMCommand.cpp:305
ola::rdm::RDMDiscoveryResponse::InflateFromData
static RDMDiscoveryResponse * InflateFromData(const uint8_t *data, unsigned int length)
Definition RDMCommand.cpp:752
ola::rdm::RDMRequest::InflateFromData
static RDMRequest * InflateFromData(const uint8_t *data, unsigned int length)
Inflate a request from some data.
Definition RDMCommand.cpp:318
ola::rdm::GetResponseWithPid
RDMResponse * GetResponseWithPid(const RDMRequest *request, uint16_t pid, const uint8_t *data, unsigned int length, uint8_t type, uint8_t outstanding_messages)
Construct an RDM response from a RDMRequest object.
Definition RDMCommand.cpp:598
ola::rdm::GetResponseFromData
RDMResponse * GetResponseFromData(const RDMRequest *request, const uint8_t *data, unsigned int length, rdm_response_type type, uint8_t outstanding_messages)
Generate an ACK Response with some data.
Definition RDMCommand.cpp:584
ola::rdm::RDMRequest::IsDUB
bool IsDUB() const
Check if this is a DUB request.
Definition RDMCommand.cpp:296
ola::rdm::RDMCommand::ToString
std::string ToString() const
Create a human readable string from the RDMCommand object.
Definition RDMCommand.cpp:112
ola::rdm::NewUnMuteRequest
RDMDiscoveryRequest * NewUnMuteRequest(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id)
Definition RDMCommand.cpp:734
ola::rdm::RDMCommand::operator<<
friend std::ostream & operator<<(std::ostream &out, const RDMCommand &command)
Output an RDMCommand object to an ostream.
Definition RDMCommand.h:97
ola::rdm::RDMDiscoveryRequest::InflateFromData
static RDMDiscoveryRequest * InflateFromData(const uint8_t *data, unsigned int length)
Inflate a discovery request.
Definition RDMCommand.cpp:650
ola::rdm::RDMCommand::SetParamData
void SetParamData(const uint8_t *data, unsigned int length)
Definition RDMCommand.cpp:171
ola::rdm::RDMRequest::SubStartCode
uint8_t SubStartCode() const
The Sub-Start code for the RDMCommand.
Definition RDMCommand.cpp:301
ola::rdm::NewMuteRequest
RDMDiscoveryRequest * NewMuteRequest(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id)
Create a new Mute Request Object.
Definition RDMCommand.cpp:716
ola::rdm::RDMRequest::Checksum
uint16_t Checksum(uint16_t checksum) const
Modify the calculated checksum for this command.
Definition RDMCommand.cpp:313
ola::rdm::RDMCommand::operator==
bool operator==(const RDMCommand &other) const
Test for equality.
Definition RDMCommand.cpp:127
ola::rdm::RDMCommand::MessageLength
virtual uint8_t MessageLength() const
The Message length field.
Definition RDMCommand.cpp:162
ola::rdm::NewDiscoveryUniqueBranchRequest
RDMDiscoveryRequest * NewDiscoveryUniqueBranchRequest(const UID &source, const UID &lower, const UID &upper, uint8_t transaction_number, uint8_t port_id)
Create a new DUB request object.
Definition RDMCommand.cpp:692
ola::plugin::artnet::RDMRequest::RDMRequest
RDMRequest(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id, uint16_t sub_device, RDMCommandClass command_class, uint16_t param_id, const uint8_t *data, unsigned int length, const OverrideOptions &options=OverrideOptions())
Create a new request.
Definition RDMCommand.cpp:280
ola::rdm::NackWithReason
RDMResponse * NackWithReason(const RDMRequest *request, rdm_nack_reason reason_enum, uint8_t outstanding_messages)
Generate a NACK response with a reason code.
Definition RDMCommand.cpp:572
ola::plugin::artnet::RDMCommand::RDMCommand
RDMCommand(const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id, uint8_t message_count, uint16_t sub_device, uint16_t param_id, const uint8_t *data, unsigned int length)
Protected constructor for derived classes.
Definition RDMCommand.cpp:84
ola::rdm::RDMResponse::InflateFromData
static RDMResponse * InflateFromData(const uint8_t *data, size_t length, RDMStatusCode *status_code, const RDMRequest *request=NULL)
Definition RDMCommand.cpp:378
ola::rdm::RDMResponse::CombineResponses
static RDMResponse * CombineResponses(const RDMResponse *response1, const RDMResponse *response2)
Combine two RDMResponses.
Definition RDMCommand.cpp:516
ola::rdm
PLASA E1.20 Remote Device Management.
Definition AckTimerResponder.cpp:38
ola::rdm::RDMCommandClass
RDMCommandClass
A set of values representing CommandClasses in E1.20.
Definition RDMEnums.h:55
ola::rdm::RDMStatusCode
RDMStatusCode
RDM Status Codes.
Definition RDMResponseCodes.h:45
ola::rdm::rdm_response_type
rdm_response_type
RDM response types.
Definition RDMResponseCodes.h:76
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
ola::plugin::artnet::RDMRequest::OverrideOptions::OverrideOptions
OverrideOptions()
Allow all fields in a RDMRequest to be specified. Using values other than the default may result in i...
Definition RDMCommand.h:242
ola::rdm::RDMCommandHeader
Definition RDMPacket.h:44
ola::rdm::RDMRequest::OverrideOptions
Definition RDMCommand.h:236
ola::rdm::RDMRequest::OverrideOptions::OverrideOptions
OverrideOptions()
Allow all fields in a RDMRequest to be specified. Using values other than the default may result in i...
Definition RDMCommand.h:242