20 #ifndef RDMNET_COMMON_PRIV_H_
21 #define RDMNET_COMMON_PRIV_H_
24 #include "rdmnet/core/client.h"
25 #include "rdmnet/core/llrp_manager.h"
26 #include "rdmnet/core/llrp_target.h"
27 #include "rdmnet/core/util.h"
39 typedef void (*RdmnetStructCleanupFunction)(
void* instance);
43 kRdmnetStructTypeController,
44 kRdmnetStructTypeDevice,
45 kRdmnetStructTypeLlrpManager,
46 kRdmnetStructTypeLlrpTarget,
47 kRdmnetStructTypeEptClient,
48 } rdmnet_struct_type_t;
50 typedef struct RdmnetStructId
53 rdmnet_struct_type_t type;
54 RdmnetStructCleanupFunction cleanup_fn;
63 kRdmHandleMethodUseCallbacks,
64 kRdmHandleMethodUseData
65 } rdm_handle_method_t;
67 #define CONTROLLER_RDM_LABEL_BUF_LENGTH 33
69 typedef struct ControllerRdmDataInternal
72 uint16_t product_category;
73 uint32_t software_version_id;
74 char manufacturer_label[CONTROLLER_RDM_LABEL_BUF_LENGTH];
75 char device_model_description[CONTROLLER_RDM_LABEL_BUF_LENGTH];
76 char software_version_label[CONTROLLER_RDM_LABEL_BUF_LENGTH];
77 char device_label[CONTROLLER_RDM_LABEL_BUF_LENGTH];
78 bool device_label_settable;
79 } ControllerRdmDataInternal;
81 typedef struct RdmnetController
87 rdm_handle_method_t rdm_handle_method;
91 ControllerRdmDataInternal data;
97 #define CONTROLLER_RDM_DATA(controller_ptr) \
98 (RDMNET_ASSERT_VERIFY(controller_ptr) ? &(controller_ptr)->rdm_handler.data : NULL)
106 kDeviceEndpointTypeVirtual = 0,
107 kDeviceEndpointTypePhysical = 1
108 } device_endpoint_type_t;
110 typedef struct EndpointResponder
115 uint16_t control_field;
118 typedef struct DeviceEndpoint
121 device_endpoint_type_t type;
122 uint32_t responder_list_change_number;
126 #define DEVICE_ENDPOINT_INIT_RESPONDER_REFS(endpoint_ptr, initial_capacity) TODO_REMOVE
127 #define DEVICE_ENDPOINT_DEINIT_RESPONDER_REFS(endpoint_ptr) TODO_REMOVE
129 typedef struct RdmnetDevice
136 uint8_t* response_buf;
138 uint32_t endpoint_list_change_number;
142 bool connected_to_broker;
143 uint16_t manufacturer_id;
146 #define DEVICE_INIT_ENDPOINTS(device_ptr, initial_capacity) \
147 (RDMNET_ASSERT_VERIFY(device_ptr) && \
148 RC_INIT_BUF(device_ptr, DeviceEndpoint, endpoints, initial_capacity, RDMNET_MAX_ENDPOINTS_PER_DEVICE))
149 #define DEVICE_DEINIT_ENDPOINTS(device_ptr) \
150 if (RDMNET_ASSERT_VERIFY(device_ptr)) \
152 RC_DEINIT_BUF(device_ptr, endpoints); \
154 #define DEVICE_CHECK_ENDPOINTS_CAPACITY(device_ptr, num_additional) \
155 (RDMNET_ASSERT_VERIFY(device_ptr) && \
156 RC_CHECK_BUF_CAPACITY(device_ptr, DeviceEndpoint, endpoints, RDMNET_MAX_ENDPOINTS_PER_DEVICE, num_additional))
158 #define DEVICE_INIT_RESPONDERS(device_ptr, initial_capacity) TODO_REMOVE
159 #define DEVICE_DEINIT_RESPONDERS(device_ptr) TODO_REMOVE
160 #define DEVICE_CHECK_RESPONDERS_CAPACITY(device_ptr, endpoint_ptr, num_additional) TODO_REMOVE
166 typedef struct LlrpManager
172 RCLlrpManager rc_manager;
179 typedef struct LlrpTarget
184 uint8_t* response_buf;
186 RCLlrpTarget rc_target;
193 typedef struct RdmnetEptClient
200 bool connected_to_broker;
203 RdmnetController* rdmnet_alloc_controller_instance(
void);
204 RdmnetDevice* rdmnet_alloc_device_instance(
void);
205 LlrpManager* rdmnet_alloc_llrp_manager_instance(
void);
206 LlrpTarget* rdmnet_alloc_llrp_target_instance(
void);
207 RdmnetEptClient* rdmnet_alloc_ept_client_instance(
void);
209 void* rdmnet_find_struct_instance(
int handle, rdmnet_struct_type_t type);
210 void rdmnet_unregister_struct_instance(
void* instance);
211 void rdmnet_free_struct_instance(
void* instance);
213 void rdmnet_init_endpoints(DeviceEndpoint* endpoints,
size_t num_endpoints);
214 void rdmnet_deinit_endpoints(DeviceEndpoint* endpoints,
size_t num_endpoints);
217 DeviceEndpoint* endpoint,
220 etcpal_error_t rdmnet_add_dynamic_responders(RdmnetDevice* device,
221 DeviceEndpoint* endpoint,
222 uint16_t manufacturer_id,
225 etcpal_error_t rdmnet_add_physical_responders(RdmnetDevice* device,
226 DeviceEndpoint* endpoint,
228 size_t num_responders);
230 EndpointResponder* rdmnet_find_responder_by_rid(DeviceEndpoint* endpoint,
const EtcPalUuid* rid);
231 EndpointResponder* rdmnet_find_responder_by_uid(DeviceEndpoint* endpoint,
const RdmUid* uid);
233 void rdmnet_remove_responders_by_rid(DeviceEndpoint* endpoint,
const EtcPalUuid* rids,
size_t num_rids);
234 void rdmnet_remove_responders_by_uid(DeviceEndpoint* endpoint,
const RdmUid* uids,
size_t num_uids);
Definitions for the RDMnet Controller API.
Definitions for the RDMnet Device API.
Definitions for the RDMnet EPT Client API.
PLATFORM_DEFINED etcpal_mutex_t
int rdmnet_client_scope_t
Definition: client.h:41
#define RDMNET_MAX_ENDPOINTS_PER_DEVICE
The maximum number of nonzero endpoints that can be added to each device instance.
Definition: opts.h:193
Functions for implementing LLRP Manager functionality.
Functions for implementing LLRP Target functionality.
Definition: llrp_manager.h:84
Definition: llrp_target.h:78
Definition: controller.h:153
Definition: controller.h:194
Definition: ept_client.h:136