RDMnet
0.3.0
Implementation of ANSI E1.33 (RDMnet)
|
View other versions:
|
An instance of RDMnet EPT client functionality.
See Using the EPT Client API for details of how to use this API.
#include <rdmnet/cpp/ept_client.h>
Data Structures | |
class | NotifyHandler |
A base class for a class that receives notification callbacks from an EPT client. More... | |
struct | Settings |
A set of configuration settings that an EPT client needs to initialize. More... | |
Public Types | |
using | Handle = rdmnet_ept_client_t |
A handle type used by the RDMnet library to identify EPT client instances. | |
Public Member Functions | |
EptClient (const EptClient &other)=delete | |
EptClient & | operator= (const EptClient &other)=delete |
EptClient (EptClient &&other)=default | |
Move an EPT client instance. | |
EptClient & | operator= (EptClient &&other)=default |
Move an EPT client instance. | |
etcpal::Error | Startup (NotifyHandler ¬ify_handler, const Settings &settings) |
Allocate resources and start up this EPT client with the given configuration. More... | |
void | Shutdown (rdmnet_disconnect_reason_t disconnect_reason=kRdmnetDisconnectShutdown) |
Shut down this EPT client and deallocate resources. More... | |
etcpal::Expected< ScopeHandle > | AddScope (const char *id, const etcpal::SockAddr &static_broker_addr=etcpal::SockAddr{}) |
Add a new scope to this EPT client instance. More... | |
etcpal::Expected< ScopeHandle > | AddScope (const Scope &scope_config) |
Add a new scope to this EPT client instance. More... | |
etcpal::Expected< ScopeHandle > | AddDefaultScope (const etcpal::SockAddr &static_broker_addr=etcpal::SockAddr{}) |
Shortcut to add the default RDMnet scope to an EPT client instance. More... | |
etcpal::Error | RemoveScope (ScopeHandle scope_handle, rdmnet_disconnect_reason_t disconnect_reason) |
Remove a previously-added scope from this EPT client instance. More... | |
etcpal::Error | RequestClientList (ScopeHandle scope_handle) |
Request a client list from a broker. More... | |
etcpal::Error | SendData (ScopeHandle scope_handle, const etcpal::Uuid &dest_cid, uint16_t manufacturer_id, uint16_t protocol_id, const uint8_t *data, size_t data_len) |
Send data from an EPT client on a scope. More... | |
etcpal::Error | SendStatus (ScopeHandle scope_handle, const etcpal::Uuid &dest_cid, ept_status_code_t status_code, const char *status_string=nullptr) |
Send a status message from an EPT client on a scope. More... | |
Handle | handle () const |
Retrieve the handle of an EPT client instance. | |
NotifyHandler * | notify_handler () const |
Retrieve the NotifyHandler reference that this EPT client was configured with. | |
etcpal::Expected< Scope > | scope (ScopeHandle scope_handle) const |
Retrieve the scope configuration associated with a given scope handle. More... | |
Static Public Attributes | |
static constexpr Handle | kInvalidHandle = RDMNET_EPT_CLIENT_INVALID |
An invalid Handle value. | |
|
inline |
Shortcut to add the default RDMnet scope to an EPT client instance.
The library will attempt to discover and connect to a broker for the default scope (or just connect if a static broker address is given); the status of these attempts will be communicated via the associated NotifyHandler.
static_broker_addr | [optional] A static broker address to configure for the default scope. |
|
inline |
Add a new scope to this EPT client instance.
The library will attempt to discover and connect to a broker for the scope (or just connect if a static broker address is given); the status of these attempts will be communicated via the associated NotifyHandler.
id | The scope ID string. |
static_broker_addr | [optional] A static IP address and port at which to connect to the broker for this scope. |
|
inline |
Add a new scope to this EPT client instance.
The library will attempt to discover and connect to a broker for the scope (or just connect if a static broker address is given); the status of these attempts will be communicated via the associated NotifyHandler.
scope_config | Configuration information for the new scope. |
|
inline |
Remove a previously-added scope from this EPT client instance.
After this call completes, scope_handle will no longer be valid.
scope_handle | Handle to the scope to remove. |
disconnect_reason | RDMnet protocol disconnect reason to send to the connected broker. |
|
inline |
Request a client list from a broker.
The response will be delivered via the NotifyHandler::HandleClientListUpdate() callback.
scope_handle | Handle to the scope on which to request the client list. |
|
inline |
Retrieve the scope configuration associated with a given scope handle.
|
inline |
Send data from an EPT client on a scope.
scope_handle | Handle to the scope on which to send data. |
dest_cid | CID of the EPT client to which to send the data. |
manufacturer_id | Manufacturer ID portion of the EPT sub-protocol identifier. |
protocol_id | Protocol ID portion of the EPT sub-protocol identifier. |
data | The data to send. |
data_len | Size in bytes of data. |
|
inline |
Send a status message from an EPT client on a scope.
scope_handle | Handle to the scope on which to send the status message. |
dest_cid | CID of the EPT client to which to send the status message. |
status_code | EPT status code to send. |
status_string | Optional status string accompanying the code. |
|
inline |
Shut down this EPT client and deallocate resources.
Will disconnect all scopes to which this EPT client is currently connected, sending the disconnect reason provided in the disconnect_reason parameter.
disconnect_reason | Reason code for disconnecting from each scope. |
|
inline |
Allocate resources and start up this EPT client with the given configuration.
notify_handler | A class instance to handle callback notifications from this EPT client. |
settings | Configuration settings used by this EPT client. |