20 #ifndef RDMNET_CPP_LLRP_MANAGER_H_
21 #define RDMNET_CPP_LLRP_MANAGER_H_
24 #include "etcpal/common.h"
71 : addr_{cid.get(), uid.get(), subdevice}
180 uint16_t manufacturer_id,
181 unsigned int netint_index,
191 const uint8_t* data =
nullptr,
192 uint8_t data_len = 0);
195 const uint8_t* data =
nullptr,
196 uint8_t data_len = 0);
199 const uint8_t* data =
nullptr,
200 uint8_t data_len = 0);
202 constexpr
Handle handle()
const;
215 extern "C" inline void LlrpManagerLibCbTargetDiscovered(
llrp_manager_t handle,
219 if (target && context)
221 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpTargetDiscovered(
Manager::Handle(handle), *target);
225 extern "C" inline void LlrpManagerLibCbRdmResponseReceived(
llrp_manager_t handle,
231 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpRdmResponse(
Manager::Handle(handle), *resp);
235 extern "C" inline void LlrpManagerLibCbDiscoveryFinished(
llrp_manager_t handle,
void* context)
239 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpDiscoveryFinished(
Manager::Handle(handle));
255 uint16_t manufacturer_id,
256 unsigned int netint_index,
260 notify_ = ¬ify_handler;
271 internal::LlrpManagerLibCbTargetDiscovered,
272 internal::LlrpManagerLibCbRdmResponseReceived,
273 internal::LlrpManagerLibCbDiscoveryFinished,
282 handle_.SetValue(c_handle);
constexpr const EtcPalUuid & get() const noexcept
static Uuid OsPreferred() noexcept
Definition: llrp_manager.h:39
A destination address for an LLRP RDM command.
Definition: llrp_manager.h:56
constexpr const LlrpDestinationAddr & get() const noexcept
Get a const reference to the underlying C type.
Definition: llrp_manager.h:77
constexpr DestinationAddr(const etcpal::Uuid &cid, const rdm::Uid &uid, uint16_t subdevice=0)
Definition: llrp_manager.h:70
A class that receives notification callbacks from an LLRP manager.
Definition: llrp_manager.h:154
virtual void HandleLlrpTargetDiscovered(Handle handle, const DiscoveredTarget &target)=0
An LLRP target has been discovered.
virtual void HandleLlrpRdmResponse(Handle handle, const RdmResponse &resp)=0
An RDM response has been received from an LLRP target.
virtual void HandleLlrpDiscoveryFinished(Handle handle)
The previously-started LLRP discovery process has finished.
Definition: llrp_manager.h:170
An instance of LLRP manager functionality.
Definition: llrp_manager.h:144
etcpal::Error StopDiscovery()
Stop LLRP discovery.
Definition: llrp_manager.h:314
etcpal::Error StartDiscovery(uint16_t filter=0)
Start LLRP discovery.
Definition: llrp_manager.h:303
Manager(Manager &&other)=default
Move a manager instance.
Manager & operator=(Manager &&other)=default
Move a manager instance.
etcpal::Expected< uint32_t > SendGetCommand(const DestinationAddr &destination, uint16_t param_id, const uint8_t *data=nullptr, uint8_t data_len=0)
Send an RDM GET command from an LLRP manager.
Definition: llrp_manager.h:352
etcpal::Error Startup(NotifyHandler ¬ify_handler, uint16_t manufacturer_id, unsigned int netint_index, etcpal_iptype_t ip_type=kEtcPalIpTypeV4, const etcpal::Uuid &cid=etcpal::Uuid::OsPreferred())
Allocate resources and startup this LLRP manager with the given configuration.
Definition: llrp_manager.h:254
etcpal::OpaqueId< detail::LlrpManagerHandleType, llrp_manager_t, LLRP_MANAGER_INVALID > Handle
A handle type used by the RDMnet library to identify LLRP manager instances.
Definition: llrp_manager.h:147
etcpal::Expected< uint32_t > SendRdmCommand(const DestinationAddr &destination, rdmnet_command_class_t command_class, uint16_t param_id, const uint8_t *data=nullptr, uint8_t data_len=0)
Send an RDM command from an LLRP manager.
Definition: llrp_manager.h:330
constexpr Handle handle() const
Retrieve the handle of an LLRP manager instance.
Definition: llrp_manager.h:385
etcpal::Expected< uint32_t > SendSetCommand(const DestinationAddr &destination, uint16_t param_id, const uint8_t *data=nullptr, uint8_t data_len=0)
Send an RDM SET command from an LLRP manager.
Definition: llrp_manager.h:373
void Shutdown()
Shut down this LLRP manager and deallocate resources.
Definition: llrp_manager.h:288
constexpr NotifyHandler * notify_handler() const
Retrieve the NotifyHandler reference that this LLRP manager was configured with.
Definition: llrp_manager.h:391
An RDM response received over LLRP and delivered to an RDMnet callback function.
Definition: llrp_rdm_response.h:45
C++ wrapper for the RDMnet init/deinit functions.
RDMnet C++ message type definitions.
etcpal_error_t llrp_manager_send_set_command(llrp_manager_t handle, const LlrpDestinationAddr *destination, uint16_t param_id, const uint8_t *data, uint8_t data_len, uint32_t *seq_num)
Send an RDM SET command from an LLRP manager.
Definition: llrp_manager.c:342
int llrp_manager_t
Definition: llrp_manager.h:51
#define LLRP_MANAGER_INVALID
Definition: llrp_manager.h:53
etcpal_error_t llrp_manager_destroy(llrp_manager_t handle)
Destroy an LLRP manager instance.
Definition: llrp_manager.c:168
etcpal_error_t llrp_manager_send_get_command(llrp_manager_t handle, const LlrpDestinationAddr *destination, uint16_t param_id, const uint8_t *data, uint8_t data_len, uint32_t *seq_num)
Send an RDM GET command from an LLRP manager.
Definition: llrp_manager.c:301
etcpal_error_t llrp_manager_send_rdm_command(llrp_manager_t handle, const LlrpDestinationAddr *destination, rdmnet_command_class_t command_class, uint16_t param_id, const uint8_t *data, uint8_t data_len, uint32_t *seq_num)
Send an RDM command from an LLRP manager.
Definition: llrp_manager.c:259
etcpal_error_t llrp_manager_stop_discovery(llrp_manager_t handle)
Stop discovery on an LLRP manager.
Definition: llrp_manager.c:226
etcpal_error_t llrp_manager_create(const LlrpManagerConfig *config, llrp_manager_t *handle)
Create a new LLRP manager instance.
Definition: llrp_manager.c:133
etcpal_error_t llrp_manager_start_discovery(llrp_manager_t handle, uint16_t filter)
Start discovery on an LLRP manager.
Definition: llrp_manager.c:200
rdmnet_command_class_t
An RDM command class, for RDMnet purposes.
Definition: common.h:371
const char * llrp_component_type_to_string(llrp_component_t type)
Get a string description of an LLRP component type.
Definition: llrp.c:46
llrp_component_t
Definition: llrp.h:59
Functions for implementing LLRP Manager functionality.
A namespace which contains all C++ language definitions in the RDMnet library.
Definition: broker.h:45
A destination address for an RDM command in LLRP.
Definition: llrp.h:48
Definition: llrp_manager.h:93
Definition: message.h:480
Represents an LLRP target discovered by a manager.
Definition: llrp_manager.h:85
etcpal::MacAddr hardware_address
The lowest hardware address of the machine the target is operating on.
Definition: llrp_manager.h:98
rdm::Uid uid
The target's RDM UID.
Definition: llrp_manager.h:97
DiscoveredTarget & operator=(const LlrpDiscoveredTarget &c_target) noexcept
Assign an instance of the C LlrpDiscoveredTarget type to an instance of this class.
Definition: llrp_manager.h:112
const char * ComponentTypeToCString() const noexcept
Convert the target's component type to a string representation.
Definition: llrp_manager.h:128
llrp_component_t component_type
The LLRP component type of the target.
Definition: llrp_manager.h:99
constexpr DestinationAddr address(uint16_t subdevice=0) const noexcept
Get the target's LLRP addressing information.
Definition: llrp_manager.h:122
etcpal::Uuid cid
The target's CID.
Definition: llrp_manager.h:96
DiscoveredTarget()=default
Construct a target with null/empty values by default.
std::string ComponentTypeToString() const
Convert the target's component type to a string representation.
Definition: llrp_manager.h:134