25 #ifndef RDMNET_DEVICE_H_
26 #define RDMNET_DEVICE_H_
29 #include "etcpal/inet.h"
30 #include "etcpal/uuid.h"
56 #define RDMNET_DEVICE_INVALID -1
175 #define RDMNET_VIRTUAL_ENDPOINT_INIT(endpoint_num) \
177 (endpoint_num), NULL, 0, NULL, 0 \
221 #define RDMNET_PHYSICAL_ENDPOINT_INIT(endpoint_num) \
223 (endpoint_num), NULL, 0 \
294 #define RDMNET_DEVICE_CONFIG_DEFAULT_INIT(manu_id) \
296 {{0}}, {NULL, NULL, NULL, NULL, NULL, NULL, NULL}, NULL, RDMNET_SCOPE_CONFIG_DEFAULT_INIT, \
297 {(0x8000 | manu_id), 0}, NULL, NULL, 0, NULL, 0 \
315 const uint8_t* response_data,
316 size_t response_data_len);
319 rdm_nack_reason_t nack_reason);
333 const char* status_string);
337 const uint8_t* response_data,
338 uint8_t response_data_len);
341 rdm_nack_reason_t nack_reason);
347 size_t num_endpoints);
352 size_t num_endpoints);
355 const uint16_t* endpoint_ids,
356 size_t num_endpoints);
359 uint16_t endpoint_id,
360 const RdmUid* responder_uids,
361 size_t num_responders);
363 uint16_t endpoint_id,
365 size_t num_responders);
367 uint16_t endpoint_id,
369 size_t num_responders);
372 uint16_t endpoint_id,
373 const RdmUid* responder_uids,
374 size_t num_responders);
376 uint16_t endpoint_id,
378 size_t num_responders);
380 uint16_t endpoint_id,
381 const RdmUid* responder_uids,
382 size_t num_responders);
388 const char* new_search_domain,
API definitions used by RDMnet clients (controllers and devices)
rdmnet_disconnect_reason_t
Definition: common.h:85
rpt_status_code_t
Definition: common.h:53
void(* RdmnetDeviceConnectFailedCallback)(rdmnet_device_t handle, const RdmnetClientConnectFailedInfo *info, void *context)
A connection attempt failed between a device and a broker.
Definition: device.h:74
etcpal_error_t rdmnet_device_remove_endpoint(rdmnet_device_t handle, uint16_t endpoint_id)
Remove an endpoint from a device.
Definition: device.c:698
etcpal_error_t rdmnet_device_add_static_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Add one or more responders with static UIDs to a virtual endpoint.
Definition: device.c:776
etcpal_error_t rdmnet_device_destroy(rdmnet_device_t handle, rdmnet_disconnect_reason_t disconnect_reason)
Destroy a device instance.
Definition: device.c:266
struct RdmnetVirtualEndpointConfig RdmnetVirtualEndpointConfig
Configuration information for a virtual endpoint on a device.
etcpal_error_t rdmnet_device_send_rdm_nack(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, rdm_nack_reason_t nack_reason)
Send an RDM NACK response from a device.
Definition: device.c:328
etcpal_error_t rdmnet_device_remove_physical_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Remove one or more responders from a physical endpoint.
Definition: device.c:1072
etcpal_error_t rdmnet_device_add_physical_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmnetPhysicalEndpointResponder *responders, size_t num_responders)
Add one or more responders to a physical endpoint.
Definition: device.c:884
struct RdmnetPhysicalEndpointConfig RdmnetPhysicalEndpointConfig
Configuration information for a physical endpoint on a device.
struct RdmnetDeviceConfig RdmnetDeviceConfig
A set of information that defines the startup parameters of an RDMnet Device.
void rdmnet_device_set_callbacks(RdmnetDeviceConfig *config, RdmnetDeviceConnectedCallback connected, RdmnetDeviceConnectFailedCallback connect_failed, RdmnetDeviceDisconnectedCallback disconnected, RdmnetDeviceRdmCommandReceivedCallback rdm_command_received, RdmnetDeviceLlrpRdmCommandReceivedCallback llrp_rdm_command_received, RdmnetDeviceDynamicUidStatusCallback dynamic_uid_status_received, void *context)
Set the main callbacks in an RDMnet device configuration structure.
Definition: device.c:191
etcpal_error_t rdmnet_device_send_rdm_update_from_responder(rdmnet_device_t handle, const RdmnetSourceAddr *source_addr, uint16_t param_id, const uint8_t *data, size_t data_len)
Send an asynchronous RDM GET response to update the value of a parameter on a sub-responder.
Definition: device.c:404
struct RdmnetDeviceCallbacks RdmnetDeviceCallbacks
etcpal_error_t rdmnet_device_change_scope(rdmnet_device_t handle, const RdmnetScopeConfig *new_scope_config, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's scope.
Definition: device.c:1146
etcpal_error_t rdmnet_device_add_physical_endpoint(rdmnet_device_t handle, const RdmnetPhysicalEndpointConfig *endpoint_config)
Add a physical endpoint to a device.
Definition: device.c:542
void(* RdmnetDeviceLlrpRdmCommandReceivedCallback)(rdmnet_device_t handle, const LlrpRdmCommand *cmd, RdmnetSyncRdmResponse *response, void *context)
An RDM command has been received over LLRP, addressed to a device.
Definition: device.h:107
etcpal_error_t rdmnet_device_send_rdm_update(rdmnet_device_t handle, uint16_t subdevice, uint16_t param_id, const uint8_t *data, size_t data_len)
Send an asynchronous RDM GET response to update the value of a local parameter.
Definition: device.c:367
struct RdmnetPhysicalEndpointResponder RdmnetPhysicalEndpointResponder
etcpal_error_t rdmnet_device_add_physical_endpoints(rdmnet_device_t handle, const RdmnetPhysicalEndpointConfig *endpoint_configs, size_t num_endpoints)
Add multiple physical endpoints to a device.
Definition: device.c:581
etcpal_error_t rdmnet_device_remove_static_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Remove one or more responders with static UIDs from a virtual endpoint.
Definition: device.c:934
etcpal_error_t rdmnet_device_add_virtual_endpoints(rdmnet_device_t handle, const RdmnetVirtualEndpointConfig *endpoint_configs, size_t num_endpoints)
Add multiple virtual endpoints to a device.
Definition: device.c:659
etcpal_error_t rdmnet_device_add_virtual_endpoint(rdmnet_device_t handle, const RdmnetVirtualEndpointConfig *endpoint_config)
Add a virtual endpoint to a device.
Definition: device.c:620
etcpal_error_t rdmnet_device_send_llrp_nack(rdmnet_device_t handle, const LlrpSavedRdmCommand *received_cmd, rdm_nack_reason_t nack_reason)
Send an ACK response to an RDM command received over LLRP.
Definition: device.c:510
etcpal_error_t rdmnet_device_change_search_domain(rdmnet_device_t handle, const char *new_search_domain, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's DNS search domain.
Definition: device.c:1184
void(* RdmnetDeviceConnectedCallback)(rdmnet_device_t handle, const RdmnetClientConnectedInfo *info, void *context)
A device has successfully connected to a broker.
Definition: device.h:64
etcpal_error_t rdmnet_device_send_llrp_ack(rdmnet_device_t handle, const LlrpSavedRdmCommand *received_cmd, const uint8_t *response_data, uint8_t response_data_len)
Send an ACK response to an RDM command received over LLRP.
Definition: device.c:477
etcpal_error_t rdmnet_device_add_dynamic_responders(rdmnet_device_t handle, uint16_t endpoint_id, const EtcPalUuid *responder_ids, size_t num_responders)
Add one or more responders with dynamic UIDs to a virtual endpoint.
Definition: device.c:830
etcpal_error_t rdmnet_device_send_rdm_ack(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, const uint8_t *response_data, size_t response_data_len)
Send an RDM ACK response from a device.
Definition: device.c:295
void(* RdmnetDeviceDisconnectedCallback)(rdmnet_device_t handle, const RdmnetClientDisconnectedInfo *info, void *context)
A device which was previously connected to a broker has disconnected.
Definition: device.h:84
void(* RdmnetDeviceRdmCommandReceivedCallback)(rdmnet_device_t handle, const RdmnetRdmCommand *cmd, RdmnetSyncRdmResponse *response, void *context)
An RDM command has been received addressed to a device.
Definition: device.h:95
int rdmnet_device_t
Definition: device.h:54
void rdmnet_device_config_init(RdmnetDeviceConfig *config, uint16_t manufacturer_id)
Initialize an RDMnet Device Config with default values for the optional config options.
Definition: device.c:165
void(* RdmnetDeviceDynamicUidStatusCallback)(rdmnet_device_t handle, const RdmnetDynamicUidAssignmentList *list, void *context)
The dynamic UID assignment status for a set of virtual responders has been received.
Definition: device.h:125
etcpal_error_t rdmnet_device_get_scope(rdmnet_device_t handle, char *scope_str_buf, EtcPalSockAddr *static_broker_addr)
Retrieve the device's current scope configuration.
Definition: device.c:1220
etcpal_error_t rdmnet_device_create(const RdmnetDeviceConfig *config, rdmnet_device_t *handle)
Create a new instance of RDMnet device functionality.
Definition: device.c:228
etcpal_error_t rdmnet_device_remove_endpoints(rdmnet_device_t handle, const uint16_t *endpoint_ids, size_t num_endpoints)
Remove multiple endpoints from a device.
Definition: device.c:733
etcpal_error_t rdmnet_device_remove_dynamic_responders(rdmnet_device_t handle, uint16_t endpoint_id, const EtcPalUuid *responder_ids, size_t num_responders)
Remove one or more responders with dynamic UIDs from a virtual endpoint.
Definition: device.c:1009
etcpal_error_t rdmnet_device_send_status(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, rpt_status_code_t status_code, const char *status_string)
Send an RPT status message from a device.
Definition: device.c:443
Basic types for parsed RDMnet messages.
Definition: message.h:440
Definition: message.h:460
RdmnetDeviceLlrpRdmCommandReceivedCallback llrp_rdm_command_received
Definition: device.h:136
RdmnetDeviceConnectedCallback connected
Definition: device.h:132
RdmnetDeviceDynamicUidStatusCallback dynamic_uid_status_received
Definition: device.h:137
RdmnetDeviceConnectFailedCallback connect_failed
Definition: device.h:133
void * context
Definition: device.h:138
RdmnetDeviceDisconnectedCallback disconnected
Definition: device.h:134
RdmnetDeviceRdmCommandReceivedCallback rdm_command_received
Definition: device.h:135
A set of information that defines the startup parameters of an RDMnet Device.
Definition: device.h:233
size_t num_physical_endpoints
Definition: device.h:275
size_t num_virtual_endpoints
Definition: device.h:280
const RdmnetVirtualEndpointConfig * virtual_endpoints
Definition: device.h:278
EtcPalUuid cid
Definition: device.h:239
RdmnetScopeConfig scope_config
Definition: device.h:257
const RdmnetPhysicalEndpointConfig * physical_endpoints
Definition: device.h:273
const char * search_domain
Definition: device.h:270
uint8_t * response_buf
Definition: device.h:251
RdmnetDeviceCallbacks callbacks
Definition: device.h:241
RdmUid uid
Definition: device.h:264
Definition: message.h:246
Configuration information for a physical endpoint on a device.
Definition: device.h:199
size_t num_responders
Definition: device.h:205
const RdmnetPhysicalEndpointResponder * responders
Definition: device.h:203
uint16_t endpoint_id
Definition: device.h:201
RdmUid binding_uid
The binding UID received in the DISC_MUTE message from this responder.
Definition: device.h:191
RdmUid uid
Definition: device.h:184
uint16_t control_field
Definition: device.h:186
The source address for an unsolicited RDM response generated by a local component.
Definition: client.h:66
Configuration information for a virtual endpoint on a device.
Definition: device.h:146
const EtcPalUuid * dynamic_responders
An array of initial virtual RDM responders on this endpoint, identified by RID.
Definition: device.h:153
const RdmUid * static_responders
Definition: device.h:157
size_t num_static_responders
Definition: device.h:159
size_t num_dynamic_responders
Definition: device.h:155
uint16_t endpoint_id
Definition: device.h:148