48 #ifndef FIRMWARE_SRC_RDM_RESPONDER_H_
49 #define FIRMWARE_SRC_RDM_RESPONDER_H_
54 #include "system_config.h"
56 #include "peripheral/ports/plib_ports.h"
78 const uint8_t *param_data);
137 RDMProductDetail ids[MAX_PRODUCT_DETAILS];
288 char device_label[RDM_DEFAULT_STRING_SIZE];
289 uint8_t uid[UID_LENGTH];
312 bool is_managed_proxy;
313 bool is_proxied_device;
334 uint8_t uid[UID_LENGTH];
385 unsigned int param_data_length);
399 unsigned int param_data_length);
401 int RDMResponder_AddHeaderAndChecksum(
const RDMHeader *incoming_header,
403 unsigned int message_length);
413 const uint8_t *param_data);
462 const uint8_t *param_data);
472 unsigned int length);
486 const char *reply_string,
487 unsigned int max_size);
506 const uint8_t *param_data,
526 const uint8_t *param_data,
546 const uint8_t *param_data,
566 const uint8_t *param_data,
590 const uint8_t *param_data);
599 const uint8_t *param_data);
608 const uint8_t *param_data);
617 const uint8_t *param_data);
626 const uint8_t *param_data);
635 const uint8_t *param_data);
644 const uint8_t *param_data);
653 const uint8_t *param_data);
662 const uint8_t *param_data);
671 const uint8_t *param_data);
680 const uint8_t *param_data);
689 const uint8_t *param_data);
698 const uint8_t *param_data);
707 const uint8_t *param_data);
716 const uint8_t *param_data);
725 const uint8_t *param_data);
734 const uint8_t *param_data);
743 const uint8_t *param_data);
752 const uint8_t *param_data);
761 const uint8_t *param_data);
771 const uint8_t *param_data);
780 const uint8_t *param_data);
789 const uint8_t *param_data);
798 const uint8_t *param_data);
807 const uint8_t *param_data);
816 const uint8_t *param_data);
826 #endif // FIRMWARE_SRC_RDM_RESPONDER_H_
int RDMResponder_SetUnMute(const RDMHeader *incoming_header)
Handle a SET UN_MUTE request.
int16_t recorded_value
The saved 'snapshot' value.
Definition: rdm_responder.h:217
bool is_muted
The mute state for the responder.
Definition: rdm_responder.h:308
uint16_t dmx_footprint
The number of slots this personality requires.
Definition: rdm_responder.h:173
RDMPrefix prefix
The prefix for the sensor values.
Definition: rdm_responder.h:207
uint8_t prefix
Data prefix.
Definition: rdm_responder.h:90
void RDMResponder_SwitchResponder(RDMResponder *responder)
Switch the current responder.
uint32_t min_valid_value
Minimum value of the parameter.
Definition: rdm_responder.h:91
int RDMResponder_GetDeviceLabel(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DEVICE_LABEL request.
int16_t lowest_value
The lowest recorded value.
Definition: rdm_responder.h:215
void RDMResponder_RestoreResponder()
Restore to the default responder.
The definition of a DMX512 personality.
Definition: rdm_responder.h:169
uint8_t slot_type
The slot type.
Definition: rdm_responder.h:158
const ResponderDefinition * def
The ResponderDefinition.
Definition: rdm_responder.h:294
int RDMResponder_GenericSetUInt8(const RDMHeader *incoming_header, const uint8_t *param_data, uint8_t *value)
Handle a request to set a uint8_t value.
int RDMResponder_DispatchPID(const RDMHeader *incoming_header, const uint8_t *param_data)
Invoke a PID handler from the ResponderDefinition.
int RDMResponder_BuildParamDescription(const RDMHeader *incoming_header, uint16_t param_id, const ParameterDescription *description)
Build a PARAMETER_DESCRIPTION response.
uint16_t slot_label_id
The slot label id.
Definition: rdm_responder.h:153
int RDMResponder_GetBootSoftwareVersionLabel(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET BOOT_SOFTWARE_LABEL request.
int RDMResponder_GetDMXStartAddress(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DMX_START_ADDRESS request.
int RDMResponder_BuildNack(const RDMHeader *incoming_header, RDMNackReason reason)
Build an RDM NACK.
uint16_t dmx_start_address
DMX start address.
Definition: rdm_responder.h:304
uint32_t default_value
The default value.
Definition: rdm_responder.h:93
int RDMResponder_BuildSetAck(const RDMHeader *incoming_header)
Build an RDM Set ACK with no param data.
RDMResponder * g_responder
The global RDMResponder object.
uint8_t recorded_value_support
Recorded support bitfield (see E1.20)
Definition: rdm_responder.h:204
The settings to use for the RDM Responder.
Definition: rdm_responder.h:329
RDMResponseType
RDM Command Classes from E1.20.
Definition: rdm.h:248
int RDMResponder_GetDefaultSlotValue(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DEFAULT_SLOT_VALUE request.
uint16_t sub_device_count
The number of sub devices.
Definition: rdm_responder.h:305
int RDMResponder_GetSlotInfo(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET SLOT_INFO request.
uint16_t model_id
The model ID.
Definition: rdm_responder.h:273
SensorData * sensors
A pointer to an array of SensorData structs.
Definition: rdm_responder.h:302
int16_t range_minimum_value
The min value of the sensor.
Definition: rdm_responder.h:201
const PIDDescriptor * descriptors
The descriptor table.
Definition: rdm_responder.h:236
RDMSensorType type
The sensor type.
Definition: rdm_responder.h:205
int RDMResponder_GetSupportedParameters(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SUPPORTED_PARAMETERS request.
Remote Device Management.
const char * description
Parameter description.
Definition: rdm_responder.h:94
int RDMResponder_SetSensorValue(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET SENSOR_VALUE request.
int16_t normal_minimum_value
The min normal range of the sensor.
Definition: rdm_responder.h:203
int RDMResponder_GenericSetBool(const RDMHeader *incoming_header, const uint8_t *param_data, bool *value)
Handle a request to set a bool value.
int(* PIDCommandHandler)(const RDMHeader *incoming_header, const uint8_t *param_data)
A PID handler.
Definition: rdm_responder.h:77
int16_t present_value
The current value of the sensor.
Definition: rdm_responder.h:214
int RDMResponder_SetRecordSensor(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET RECORD_SENSOR request.
RDMCommandClass
RDM Command Classes from E1.20.
Definition: rdm.h:235
void RDMResponder_ResetToFactoryDefaults()
Reset an RDMResponder to the factory defaults.
const char * model_description
The model description.
Definition: rdm_responder.h:254
int RDMResponder_GetManufacturerLabel(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET MANUFACTURER_LABEL request.
int RDMResponder_GetDMXPersonality(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DMX_PERSONALITY request.
A parameter description.
Definition: rdm_responder.h:85
uint8_t command_class
Command classes accepted.
Definition: rdm_responder.h:88
The Product Detail IDs for the responder.
Definition: rdm_responder.h:133
uint32_t max_valid_value
Maximum value of the parameter.
Definition: rdm_responder.h:92
unsigned int descriptor_count
The number of descriptors in the table.
Definition: rdm_responder.h:265
int16_t normal_maximum_value
The max normal range of the sensor.
Definition: rdm_responder.h:202
uint8_t pdl_size
Size of the parameter data.
Definition: rdm_responder.h:86
bool using_factory_defaults
True if using factory defaults.
Definition: rdm_responder.h:310
const PersonalityDefinition * personalities
The personality definition table.
Definition: rdm_responder.h:250
RDMUnit unit
The units for the sensor values.
Definition: rdm_responder.h:206
int RDMResponder_GetDMXPersonalityDescription(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DMX_PERSONALITY_DESCRIPTION request.
const char * software_version_label
The software version label.
Definition: rdm_responder.h:252
uint8_t default_value
The default slot value.
Definition: rdm_responder.h:163
int RDMResponder_GenericGetUInt8(const RDMHeader *incoming_header, uint8_t value)
Handle a request to get a uint8_t value.
int RDMResponder_GetSoftwareVersionLabel(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET SOFTWARE_VERSION_LABEL request.
const ProductDetailIds * product_detail_ids
The list of product IDs.
Definition: rdm_responder.h:260
PIDCommandHandler set_handler
The handler to use for SET requests.
Definition: rdm_responder.h:125
int RDMResponder_GenericGetUInt32(const RDMHeader *incoming_header, uint32_t value)
Handle a request to get a uint32_t value.
The handler for RDM requests.
The definition of a DMX slot.
Definition: rdm_responder.h:144
uint8_t unit
Data units.
Definition: rdm_responder.h:89
int RDMResponder_GenericSetUInt16(const RDMHeader *incoming_header, const uint8_t *param_data, uint16_t *value)
Handle a request to set a uint16_t value.
Data for an RDM Sensor.
Definition: rdm_responder.h:213
int16_t highest_value
The highest recorded value.
Definition: rdm_responder.h:216
int RDMResponder_Ioctl(ModelIoctl command, uint8_t *data, unsigned int length)
A base Ioctl handler.
void RDMResponder_Tasks()
Perform the periodic tasks.
int RDMResponder_BuildAckTimer(const RDMHeader *incoming_header, uint16_t delay)
Build an ACK TIMER.
static const int RDM_RESPONDER_NO_RESPONSE
Indicates there is no response required for the request.
Definition: rdm_responder.h:324
const char * description
Pointer to the sensor description.
Definition: rdm_responder.h:199
RDMNackReason
RDM NACK reason codes from E1.20.
Definition: rdm.h:389
Remote Device Management.
int RDMResponder_GenericGetBool(const RDMHeader *incoming_header, bool value)
Handle a request to get a bool value.
const char * description
The string description of the personality.
Definition: rdm_responder.h:178
int RDMResponder_SetMute(const RDMHeader *incoming_header)
Handle a SET MUTE request.
int RDMResponder_GenericReturnString(const RDMHeader *incoming_header, const char *reply_string, unsigned int max_size)
Build a response containing a string.
int RDMResponder_SetDMXStartAddress(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET DMX_START_ADDRESS request.
uint8_t get_param_size
The size of the parameter data for GET requests.
Definition: rdm_responder.h:118
int RDMResponder_GetIdentifyDevice(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET IDENTIFY_DEVICE request.
ModelIoctl
Model ioctl enums.
Definition: rdm_model.h:101
uint8_t data_type
Data type.
Definition: rdm_responder.h:87
const char * manufacturer_label
The manufacturer label.
Definition: rdm_responder.h:253
uint16_t pid
The parameter ID.
Definition: rdm_responder.h:106
const SlotDefinition * slots
The slot definitions.
Definition: rdm_responder.h:185
PORTS_CHANNEL mute_port
The port to use to indicate mute state.
Definition: rdm_responder.h:332
int RDMResponder_SetDeviceLabel(const RDMHeader *incoming_header, const uint8_t *param_data)
PORTS_BIT_POS identify_bit
The port bit to use for the identify signal.
Definition: rdm_responder.h:331
int RDMResponder_GenericSetUInt32(const RDMHeader *incoming_header, const uint8_t *param_data, uint32_t *value)
Handle a request to set a uint32_t value.
void RDMResponder_GetUID(uint8_t *uid)
Get the UID of the responder.
void RDMResponder_InitResponder()
Initialize the current responder with default values.
int RDMResponder_GetDeviceInfo(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DEVICE_INFO request.
int RDMResponder_GetSensorDefinition(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET SENSOR_DEFINITION request.
void RDMResponder_Initialize(const RDMResponderSettings *settings)
Initialize an RDMResponder struct.
An RDM sensor definition.
Definition: rdm_responder.h:198
int RDMResponder_GetCommsStatus(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET COMMS_STATUS request.
PORTS_BIT_POS mute_bit
The port bit used to indicate mute state.
Definition: rdm_responder.h:333
const SensorDefinition * sensors
The sensor definitions table.
Definition: rdm_responder.h:243
uint8_t sensor_count
The number of sensor definitions in the table.
Definition: rdm_responder.h:279
void RDMResponder_BuildHeader(const RDMHeader *incoming_header, RDMResponseType response_type, RDMCommandClass command_class, uint16_t pid, unsigned int param_data_length)
Build the RDM header in the output buffer.
uint16_t slot_count
The number of slot definitions.
Definition: rdm_responder.h:190
PIDCommandHandler get_handler
The handler to use for GET requests.
Definition: rdm_responder.h:113
int16_t range_maximum_value
The max value of the sensor.
Definition: rdm_responder.h:200
PORTS_CHANNEL identify_port
The port to use for the identify signal.
Definition: rdm_responder.h:330
const char * description
The string description of the slot.
Definition: rdm_responder.h:148
int RDMResponder_SetIdentifyDevice(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET IDENTIFY_DEVICE request.
unsigned int personality_count
The number of personality definitions in the table.
Definition: rdm_responder.h:270
int RDMResponder_GetProductDetailIds(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET PRODUCT_DETAIL_IDS request.
int RDMResponder_GetDeviceModelDescription(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET DEVICE_MODEL_DESCRIPTION request.
int RDMResponder_GetSensorValue(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET SENSOR_VALUE request.
RDMNackReason nack_reason
Optional NACK reason, used if should_nack is true.
Definition: rdm_responder.h:221
int RDMResponder_GetSlotDescription(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET SLOT_DESCRIPTION request.
uint8_t current_personality
Current DMX personality, 1-indexed.
Definition: rdm_responder.h:306
uint8_t queued_message_count
queued message count.
Definition: rdm_responder.h:307
A core implementation of a responder.
Definition: rdm_responder.h:287
bool identify_on
The identify state for the responder.
Definition: rdm_responder.h:309
uint32_t software_version
The Software version.
Definition: rdm_responder.h:272
int RDMResponder_GetBootSoftwareVersion(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a GET BOOT_SOFTWARE_VERSION request.
const char MANUFACTURER_LABEL[]
The common MANUFACTURER_LABEL.
const char * default_device_label
The default device label.
Definition: rdm_responder.h:255
int RDMResponder_SetCommsStatus(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET COMMS_STATUS request.
int RDMResponder_SetDMXPersonality(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle a SET DMX_PERSONALITY request.
bool should_nack
True if we should NACK SENSOR_VALUE requests.
Definition: rdm_responder.h:223
uint8_t size
The number of ids in the array.
Definition: rdm_responder.h:138
A descriptor for a PID.
Definition: rdm_responder.h:102
int RDMResponder_HandleDUBRequest(const uint8_t *param_data, unsigned int param_data_length)
Handle a Discovery-unique-branch request.
RDMProductCategory product_category
The product category.
Definition: rdm_responder.h:274
The definition of a responder.
Definition: rdm_responder.h:232
int RDMResponder_GenericGetUInt16(const RDMHeader *incoming_header, uint16_t value)
Handle a request to get a uint16_t value.
int RDMResponder_HandleDiscovery(const RDMHeader *incoming_header, const uint8_t *param_data)
Handle discovery commands.