20 #ifndef RDMNET_CPP_LLRP_MANAGER_H_
21 #define RDMNET_CPP_LLRP_MANAGER_H_
24 #include "etcpal/common.h"
62 : addr_{cid.get(), uid.get(), subdevice}
173 uint16_t manufacturer_id,
174 unsigned int netint_index,
184 const uint8_t* data =
nullptr,
185 uint8_t data_len = 0);
188 const uint8_t* data =
nullptr,
189 uint8_t data_len = 0);
192 const uint8_t* data =
nullptr,
193 uint8_t data_len = 0);
195 constexpr
Handle handle()
const;
199 Handle handle_{kInvalidHandle};
200 NotifyHandler* notify_{
nullptr};
208 extern "C" inline void LlrpManagerLibCbTargetDiscovered(
llrp_manager_t handle,
212 if (target && context)
214 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpTargetDiscovered(handle, *target);
218 extern "C" inline void LlrpManagerLibCbRdmResponseReceived(
llrp_manager_t handle,
224 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpRdmResponse(handle, *resp);
228 extern "C" inline void LlrpManagerLibCbDiscoveryFinished(
llrp_manager_t handle,
void* context)
232 static_cast<Manager::NotifyHandler*
>(context)->HandleLlrpDiscoveryFinished(handle);
248 uint16_t manufacturer_id,
249 unsigned int netint_index,
253 notify_ = ¬ify_handler;
264 internal::LlrpManagerLibCbTargetDiscovered,
265 internal::LlrpManagerLibCbRdmResponseReceived,
266 internal::LlrpManagerLibCbDiscoveryFinished,
279 handle_ = kInvalidHandle;
constexpr const EtcPalUuid & get() const noexcept
static Uuid OsPreferred() noexcept
A destination address for an LLRP RDM command.
Definition: llrp_manager.h:47
constexpr DestinationAddr(const etcpal::Uuid &cid, const rdm::Uid &uid, uint16_t subdevice=0)
Construct a destination address from its component parts.
Definition: llrp_manager.h:61
constexpr const LlrpDestinationAddr & get() const noexcept
Get a const reference to the underlying C type.
Definition: llrp_manager.h:68
A class that receives notification callbacks from an LLRP manager.
Definition: llrp_manager.h:147
virtual void HandleLlrpDiscoveryFinished(Handle handle)
The previously-started LLRP discovery process has finished.
Definition: llrp_manager.h:163
virtual void HandleLlrpRdmResponse(Handle handle, const RdmResponse &resp)=0
An RDM response has been received from an LLRP target.
virtual void HandleLlrpTargetDiscovered(Handle handle, const DiscoveredTarget &target)=0
An LLRP target has been discovered.
An instance of LLRP manager functionality.
Definition: llrp_manager.h:135
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:340
void Shutdown()
Shut down this LLRP manager and deallocate resources.
Definition: llrp_manager.h:276
constexpr NotifyHandler * notify_handler() const
Retrieve the NotifyHandler reference that this LLRP manager was configured with.
Definition: llrp_manager.h:377
Manager(Manager &&other)=default
Move a manager instance.
llrp_manager_t Handle
A handle type used by the RDMnet library to identify LLRP manager instances.
Definition: llrp_manager.h:138
Manager & operator=(Manager &&other)=default
Move a manager instance.
etcpal::Error StopDiscovery()
Stop LLRP discovery.
Definition: llrp_manager.h:302
constexpr Handle handle() const
Retrieve the handle of an LLRP manager instance.
Definition: llrp_manager.h:371
etcpal::Error StartDiscovery(uint16_t filter=0)
Start LLRP discovery.
Definition: llrp_manager.h:291
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:247
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:318
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:360
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:316
int llrp_manager_t
A handle for an instance of LLRP Manager functionality.
Definition: llrp_manager.h:51
#define LLRP_MANAGER_INVALID
An invalid LLRP manager handle value.
Definition: llrp_manager.h:53
etcpal_error_t llrp_manager_destroy(llrp_manager_t handle)
Destroy an LLRP manager instance.
Definition: llrp_manager.c:163
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:281
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:245
etcpal_error_t llrp_manager_stop_discovery(llrp_manager_t handle)
Stop discovery on an LLRP manager.
Definition: llrp_manager.c:215
etcpal_error_t llrp_manager_create(const LlrpManagerConfig *config, llrp_manager_t *handle)
Create a new LLRP manager instance.
Definition: llrp_manager.c:128
etcpal_error_t llrp_manager_start_discovery(llrp_manager_t handle, uint16_t filter)
Start discovery on an LLRP manager.
Definition: llrp_manager.c:192
rdmnet_command_class_t
An RDM command class, for RDMnet purposes.
Definition: common.h:350
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
Identifies the type of RPT Component with which an LLRP Target is associated.
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
A set of information associated with an LLRP Target.
Definition: llrp.h:72
A set of information that defines the startup parameters of an LLRP Manager.
Definition: llrp_manager.h:93
An RDM response received from a remote LLRP Target.
Definition: message.h:479
Represents an LLRP target discovered by a manager.
Definition: llrp_manager.h:76
etcpal::MacAddr hardware_address
The lowest hardware address of the machine the target is operating on.
Definition: llrp_manager.h:89
llrp_component_t component_type
The LLRP component type of the target.
Definition: llrp_manager.h:90
const char * ComponentTypeToCString() const noexcept
Convert the target's component type to a string representation.
Definition: llrp_manager.h:119
std::string ComponentTypeToString() const
Convert the target's component type to a string representation.
Definition: llrp_manager.h:125
etcpal::Uuid cid
The target's CID.
Definition: llrp_manager.h:87
rdm::Uid uid
The target's RDM UID.
Definition: llrp_manager.h:88
DiscoveredTarget()=default
Construct a target with null/empty values by default.
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:103
constexpr DestinationAddr address(uint16_t subdevice=0) const noexcept
Get the target's LLRP addressing information.
Definition: llrp_manager.h:113