OLE Developer Guide  Latest Git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rdm_responder.h File Reference

Detailed Description

The base RDM Responder.

The base RDM Responder provides the common RDM handling code used by many of the responder models. This allows much of the responder's functionality to be specified with a declarative style, rather that reimplementing the PID handlers many times over.

It consists of a couple of parts:

  • A ResponderDefinition, a static tree of data structures that describe how the responder should behave. This contains the responder's manufacturer id, model id, sensors definitions, personalities definitions, supported parameters list etc.
  • the global RDMResponder g_responder object, which holds basic state like mute, identify etc.
  • The PID dispatching mechanism, where we specify a table of function pointers as part of the responder definition and then later, when a RDM request arrives, RDMResponder_DispatchPID() is called which invokes the correct function. You can think of this like a vtable in C++.

When implementing a model, you can reference the PID functions in the dispatch table, or point to your own functions that (optionally) wrap the PID functions.

Include dependency graph for rdm_responder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ParameterDescription
 A parameter description. More...
 
struct  PIDDescriptor
 A descriptor for a PID. More...
 
struct  ProductDetailIds
 The Product Detail IDs for the responder. More...
 
struct  SlotDefinition
 The definition of a DMX slot. More...
 
struct  PersonalityDefinition
 The definition of a DMX512 personality. More...
 
struct  SensorDefinition
 An RDM sensor definition. More...
 
struct  SensorData
 Data for an RDM Sensor. More...
 
struct  ResponderDefinition
 The definition of a responder. More...
 
struct  RDMResponder
 A core implementation of a responder. More...
 
struct  RDMResponderSettings
 The settings to use for the RDM Responder. More...
 

Typedefs

typedef int(* PIDCommandHandler )(const RDMHeader *incoming_header, const uint8_t *param_data)
 A PID handler. More...
 

Functions

void RDMResponder_Initialize (const RDMResponderSettings *settings)
 Initialize an RDMResponder struct. More...
 
void RDMResponder_Tasks ()
 Perform the periodic tasks. More...
 
void RDMResponder_SwitchResponder (RDMResponder *responder)
 Switch the current responder. More...
 
void RDMResponder_RestoreResponder ()
 Restore to the default responder.
 
void RDMResponder_InitResponder ()
 Initialize the current responder with default values.
 
void RDMResponder_ResetToFactoryDefaults ()
 Reset an RDMResponder to the factory defaults.
 
void RDMResponder_GetUID (uint8_t *uid)
 Get the UID of the responder. More...
 
int RDMResponder_HandleDUBRequest (const uint8_t *param_data, unsigned int param_data_length)
 Handle a Discovery-unique-branch request. More...
 
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. More...
 
int RDMResponder_AddHeaderAndChecksum (const RDMHeader *incoming_header, RDMResponseType response_type, unsigned int message_length)
 
int RDMResponder_HandleDiscovery (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle discovery commands. More...
 
int RDMResponder_BuildSetAck (const RDMHeader *incoming_header)
 Build an RDM Set ACK with no param data. More...
 
int RDMResponder_BuildNack (const RDMHeader *incoming_header, RDMNackReason reason)
 Build an RDM NACK. More...
 
int RDMResponder_BuildAckTimer (const RDMHeader *incoming_header, uint16_t delay)
 Build an ACK TIMER. More...
 
int RDMResponder_BuildParamDescription (const RDMHeader *incoming_header, uint16_t param_id, const ParameterDescription *description)
 Build a PARAMETER_DESCRIPTION response. More...
 
int RDMResponder_DispatchPID (const RDMHeader *incoming_header, const uint8_t *param_data)
 Invoke a PID handler from the ResponderDefinition. More...
 
int RDMResponder_Ioctl (ModelIoctl command, uint8_t *data, unsigned int length)
 A base Ioctl handler. More...
 
int RDMResponder_GenericReturnString (const RDMHeader *incoming_header, const char *reply_string, unsigned int max_size)
 Build a response containing a string. More...
 
int RDMResponder_GenericGetBool (const RDMHeader *incoming_header, bool value)
 Handle a request to get a bool value. More...
 
int RDMResponder_GenericSetBool (const RDMHeader *incoming_header, const uint8_t *param_data, bool *value)
 Handle a request to set a bool value. More...
 
int RDMResponder_GenericGetUInt8 (const RDMHeader *incoming_header, uint8_t value)
 Handle a request to get a uint8_t value. More...
 
int RDMResponder_GenericSetUInt8 (const RDMHeader *incoming_header, const uint8_t *param_data, uint8_t *value)
 Handle a request to set a uint8_t value. More...
 
int RDMResponder_GenericGetUInt16 (const RDMHeader *incoming_header, uint16_t value)
 Handle a request to get a uint16_t value. More...
 
int RDMResponder_GenericSetUInt16 (const RDMHeader *incoming_header, const uint8_t *param_data, uint16_t *value)
 Handle a request to set a uint16_t value. More...
 
int RDMResponder_GenericGetUInt32 (const RDMHeader *incoming_header, uint32_t value)
 Handle a request to get a uint32_t value. More...
 
int RDMResponder_GenericSetUInt32 (const RDMHeader *incoming_header, const uint8_t *param_data, uint32_t *value)
 Handle a request to set a uint32_t value. More...
 
int RDMResponder_SetMute (const RDMHeader *incoming_header)
 Handle a SET MUTE request. More...
 
int RDMResponder_SetUnMute (const RDMHeader *incoming_header)
 Handle a SET UN_MUTE request. More...
 
int RDMResponder_GetCommsStatus (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET COMMS_STATUS request. More...
 
int RDMResponder_SetCommsStatus (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET COMMS_STATUS request. More...
 
int RDMResponder_GetDeviceInfo (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DEVICE_INFO request. More...
 
int RDMResponder_GetSupportedParameters (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SUPPORTED_PARAMETERS request. More...
 
int RDMResponder_GetProductDetailIds (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET PRODUCT_DETAIL_IDS request. More...
 
int RDMResponder_GetDeviceModelDescription (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DEVICE_MODEL_DESCRIPTION request. More...
 
int RDMResponder_GetManufacturerLabel (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET MANUFACTURER_LABEL request. More...
 
int RDMResponder_GetSoftwareVersionLabel (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET SOFTWARE_VERSION_LABEL request. More...
 
int RDMResponder_GetBootSoftwareVersion (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET BOOT_SOFTWARE_VERSION request. More...
 
int RDMResponder_GetBootSoftwareVersionLabel (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET BOOT_SOFTWARE_LABEL request. More...
 
int RDMResponder_GetDeviceLabel (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DEVICE_LABEL request. More...
 
int RDMResponder_SetDeviceLabel (const RDMHeader *incoming_header, const uint8_t *param_data)
 
int RDMResponder_GetDMXPersonality (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DMX_PERSONALITY request. More...
 
int RDMResponder_SetDMXPersonality (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET DMX_PERSONALITY request. More...
 
int RDMResponder_GetDMXPersonalityDescription (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DMX_PERSONALITY_DESCRIPTION request. More...
 
int RDMResponder_GetDMXStartAddress (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DMX_START_ADDRESS request. More...
 
int RDMResponder_SetDMXStartAddress (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET DMX_START_ADDRESS request. More...
 
int RDMResponder_GetSlotInfo (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET SLOT_INFO request. More...
 
int RDMResponder_GetSlotDescription (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET SLOT_DESCRIPTION request. More...
 
int RDMResponder_GetDefaultSlotValue (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET DEFAULT_SLOT_VALUE request. More...
 
int RDMResponder_GetSensorDefinition (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET SENSOR_DEFINITION request. More...
 
int RDMResponder_GetSensorValue (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET SENSOR_VALUE request. More...
 
int RDMResponder_SetSensorValue (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET SENSOR_VALUE request. More...
 
int RDMResponder_SetRecordSensor (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET RECORD_SENSOR request. More...
 
int RDMResponder_GetIdentifyDevice (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a GET IDENTIFY_DEVICE request. More...
 
int RDMResponder_SetIdentifyDevice (const RDMHeader *incoming_header, const uint8_t *param_data)
 Handle a SET IDENTIFY_DEVICE request. More...
 

Variables

const char MANUFACTURER_LABEL []
 The common MANUFACTURER_LABEL.
 
RDMResponderg_responder
 The global RDMResponder object.
 
static const int RDM_RESPONDER_NO_RESPONSE = 0
 Indicates there is no response required for the request.