OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
RDM Request Handler

Detailed Description

The handler for RDM requests.

The RDM Handler manages dispatching the RDM requests to the correct model. This allows the physical device to simulate different types of RDM devices from LED drivers and moving lights to sensor-only devices and fog machines.

Only a single model can be active at once, the PID_DEVICE_MODEL parameter can be used to change models at run time. Note that PID_DEVICE_MODEL and PID_DEVICE_MODEL_LIST aren't included in SUPPORTED_PARAMETERS so they are 'hidden' PIDs.

Files

file  rdm_handler.h
 The handler for RDM requests.
 

Data Structures

struct  RDMHandlerSettings
 The settings to use for the RDM Handler. More...
 

Typedefs

typedef void(* RDMHandlerSendCallback )(bool include_break, const IOVec *data, unsigned int iov_count)
 The callback used to send RDM responses. More...
 

Functions

void RDMHandler_Initialize (const RDMHandlerSettings *settings)
 Initialize the RDM Handler sub-system. More...
 
bool RDMHandler_AddModel (const ModelEntry *entry)
 Add a model to the list of available models. More...
 
bool RDMHandler_SetActiveModel (uint16_t model_id)
 Change the active model of responder. More...
 
uint16_t RDMHandler_ActiveModel ()
 Get the active model id. More...
 
void RDMHandler_HandleRequest (const RDMHeader *header, const uint8_t *param_data)
 Handle a RDM Request. More...
 
void RDMHandler_GetUID (uint8_t *uid)
 Get the UID of the responder. More...
 
void RDMHandler_Tasks ()
 Perform the periodic RDM Handler tasks. More...
 

Typedef Documentation

typedef void(* RDMHandlerSendCallback)(bool include_break, const IOVec *data, unsigned int iov_count)

The callback used to send RDM responses.

Parameters
include_breaktrue if a break should be used for the response
datathe raw data to send in the response
iov_countthe number of IOVec that make up the response

Function Documentation

uint16_t RDMHandler_ActiveModel ( )

Get the active model id.

Returns
the active model id.
bool RDMHandler_AddModel ( const ModelEntry entry)

Add a model to the list of available models.

model_entry The ModelEntry to add.

Returns
true if the model was added, false if there weren't enough slots or the model already existed.

This should be called after to RDMHandler_Initialize().

void RDMHandler_GetUID ( uint8_t *  uid)

Get the UID of the responder.

Parameters
[out]uidA pointer to copy the UID to; should be at least UID_LENGTH.

If no model is active, the UID will be 0000:00000000.

void RDMHandler_HandleRequest ( const RDMHeader *  header,
const uint8_t *  param_data 
)

Handle a RDM Request.

Precondition
Sub-Start-Code is SUB_START_CODE.
message_length is valid.
The checksum of the command is correct
Parameters
headerThe RDM command header.
param_datathe parameter data
void RDMHandler_Initialize ( const RDMHandlerSettings settings)

Initialize the RDM Handler sub-system.

Parameters
settingsThe settings for the handler.
bool RDMHandler_SetActiveModel ( uint16_t  model_id)

Change the active model of responder.

Parameters
model_idthe new model to use.
Returns
true if the new model was set, false if the new model doesn't exist.
void RDMHandler_Tasks ( )

Perform the periodic RDM Handler tasks.

This should be called in the main event loop, it delegates to calling the tasks_fn on the active model.