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) (&(controller_ptr)->rdm_handler.data)
105 kDeviceEndpointTypeVirtual = 0,
106 kDeviceEndpointTypePhysical = 1
107 } device_endpoint_type_t;
109 typedef struct EndpointResponder
114 uint16_t control_field;
117 typedef struct DeviceEndpoint
120 device_endpoint_type_t type;
121 uint32_t responder_list_change_number;
125 #define DEVICE_ENDPOINT_INIT_RESPONDERS(endpoint_ptr, initial_capacity) \
126 RC_INIT_BUF(endpoint_ptr, EndpointResponder, responders, initial_capacity, RDMNET_MAX_RESPONDERS_PER_DEVICE_ENDPOINT)
127 #define DEVICE_ENDPOINT_DEINIT_RESPONDERS(endpoint_ptr) RC_DEINIT_BUF(endpoint_ptr, responders)
128 #define DEVICE_ENDPOINT_CHECK_RESPONDERS_CAPACITY(endpoint_ptr, num_additional) \
129 RC_CHECK_BUF_CAPACITY(endpoint_ptr, EndpointResponder, responders, RDMNET_MAX_RESPONDERS_PER_DEVICE_ENDPOINT, \
132 typedef struct RdmnetDevice
139 uint8_t* response_buf;
141 uint32_t endpoint_list_change_number;
145 bool connected_to_broker;
146 uint16_t manufacturer_id;
149 #define DEVICE_INIT_ENDPOINTS(device_ptr, initial_capacity) \
150 RC_INIT_BUF(device_ptr, DeviceEndpoint, endpoints, initial_capacity, RDMNET_MAX_ENDPOINTS_PER_DEVICE)
151 #define DEVICE_DEINIT_ENDPOINTS(device_ptr) RC_DEINIT_BUF(device_ptr, endpoints)
152 #define DEVICE_CHECK_ENDPOINTS_CAPACITY(device_ptr, num_additional) \
153 RC_CHECK_BUF_CAPACITY(device_ptr, DeviceEndpoint, endpoints, RDMNET_MAX_ENDPOINTS_PER_DEVICE, num_additional)
159 typedef struct LlrpManager
165 RCLlrpManager rc_manager;
172 typedef struct LlrpTarget
177 uint8_t* response_buf;
179 RCLlrpTarget rc_target;
186 typedef struct RdmnetEptClient
193 bool connected_to_broker;
196 RdmnetController* rdmnet_alloc_controller_instance(
void);
197 RdmnetDevice* rdmnet_alloc_device_instance(
void);
198 LlrpManager* rdmnet_alloc_llrp_manager_instance(
void);
199 LlrpTarget* rdmnet_alloc_llrp_target_instance(
void);
200 RdmnetEptClient* rdmnet_alloc_ept_client_instance(
void);
202 void* rdmnet_find_struct_instance(
int handle, rdmnet_struct_type_t type);
203 void rdmnet_unregister_struct_instance(
void* instance);
204 void rdmnet_free_struct_instance(
void* instance);
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
A handle to a scope that an RDMnet client participates in.
Definition: client.h:41
#define RDMNET_MAX_RESPONDERS_PER_DEVICE_ENDPOINT
The maximum number of responders that can be added to each device endpoint.
Definition: opts.h:180
#define RDMNET_MAX_ENDPOINTS_PER_DEVICE
The maximum number of nonzero endpoints that can be added to each device instance.
Definition: opts.h:171
Functions for implementing LLRP Manager functionality.
Functions for implementing LLRP Target functionality.
A set of notification callbacks received about an LLRP manager.
Definition: llrp_manager.h:84
A set of notification callbacks received about an LLRP target.
Definition: llrp_target.h:78
A set of notification callbacks received about a controller.
Definition: controller.h:151
A buffer and set of callbacks which can be optionally provided to handle RDM commands addressed to a ...
Definition: controller.h:192
A set of notification callbacks received about a device.
Definition: device.h:130
A set of notification callbacks received about an EPT client.
Definition: ept_client.h:136