RDMnet  0.3.0
Implementation of ANSI E1.33 (RDMnet)
View other versions:
device.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 ETC Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************
16  * This file is a part of RDMnet. For more information, go to:
17  * https://github.com/ETCLabs/RDMnet
18  *****************************************************************************/
19 
22 
23 #ifndef RDMNET_CPP_DEVICE_H_
24 #define RDMNET_CPP_DEVICE_H_
25 
26 #include <algorithm>
27 #include <iterator>
28 #include <string>
29 #include <utility>
30 #include <vector>
31 #include "etcpal/cpp/common.h"
32 #include "etcpal/cpp/inet.h"
33 #include "etcpal/cpp/log.h"
34 #include "rdm/cpp/uid.h"
35 #include "rdmnet/device.h"
36 #include "rdmnet/cpp/common.h"
37 #include "rdmnet/cpp/client.h"
38 #include "rdmnet/cpp/message.h"
39 
40 namespace rdmnet
41 {
51 
71 {
72 public:
73  VirtualEndpointConfig(uint16_t id,
74  const etcpal::Uuid* dynamic_responders = nullptr,
75  size_t num_dynamic_responders = 0);
76  VirtualEndpointConfig(uint16_t id, const std::vector<etcpal::Uuid>& dynamic_responders);
77  VirtualEndpointConfig(uint16_t id,
78  const rdm::Uid* static_responders,
79  size_t num_static_responders,
80  const etcpal::Uuid* dynamic_responders = nullptr,
81  size_t num_dynamic_responders = 0);
82  VirtualEndpointConfig(uint16_t id,
83  const std::vector<rdm::Uid>& static_responders,
84  const std::vector<etcpal::Uuid>& dynamic_responders = std::vector<etcpal::Uuid>{});
85 
86  const RdmnetVirtualEndpointConfig& get() const noexcept;
87 
88 private:
89  void UpdateConfig();
90 
91  std::vector<EtcPalUuid> dynamic_responders_;
92  std::vector<RdmUid> static_responders_;
94 };
95 
101  const etcpal::Uuid* dynamic_responders,
102  size_t num_dynamic_responders)
103  : config_{id, nullptr, 0, nullptr, 0}
104 {
105  if (dynamic_responders && num_dynamic_responders)
106  {
107  std::transform(dynamic_responders, dynamic_responders + num_dynamic_responders,
108  std::back_inserter(dynamic_responders_), [](const etcpal::Uuid& rid) { return rid.get(); });
109  }
110  UpdateConfig();
111 }
112 
116 inline VirtualEndpointConfig::VirtualEndpointConfig(uint16_t id, const std::vector<etcpal::Uuid>& dynamic_responders)
117  : config_{id, nullptr, 0, nullptr, 0}
118 {
119  if (!dynamic_responders.empty())
120  {
121  std::transform(dynamic_responders.begin(), dynamic_responders.end(), std::back_inserter(dynamic_responders_),
122  [](const etcpal::Uuid& rid) { return rid.get(); });
123  }
124  UpdateConfig();
125 }
126 
136  const rdm::Uid* static_responders,
137  size_t num_static_responders,
138  const etcpal::Uuid* dynamic_responders,
139  size_t num_dynamic_responders)
140  : config_{id, nullptr, 0, nullptr, 0}
141 {
142  if (static_responders && num_static_responders)
143  {
144  std::transform(static_responders, static_responders + num_static_responders, std::back_inserter(static_responders_),
145  [](const rdm::Uid& uid) { return uid.get(); });
146  }
147  if (dynamic_responders && num_dynamic_responders)
148  {
149  std::transform(dynamic_responders, dynamic_responders + num_dynamic_responders,
150  std::back_inserter(dynamic_responders_), [](const etcpal::Uuid& rid) { return rid.get(); });
151  }
152  UpdateConfig();
153 }
154 
162  const std::vector<rdm::Uid>& static_responders,
163  const std::vector<etcpal::Uuid>& dynamic_responders)
164  : config_{id, nullptr, 0, nullptr, 0}
165 {
166  if (!static_responders.empty())
167  {
168  std::transform(static_responders.begin(), static_responders.end(), std::back_inserter(static_responders_),
169  [](const rdm::Uid& uid) { return uid.get(); });
170  }
171  if (!dynamic_responders.empty())
172  {
173  std::transform(dynamic_responders.begin(), dynamic_responders.end(), std::back_inserter(dynamic_responders_),
174  [](const etcpal::Uuid& rid) { return rid.get(); });
175  }
176  UpdateConfig();
177 }
178 
181 {
182  return config_;
183 }
184 
185 // Sets the values of the encapsulated config correctly.
186 inline void VirtualEndpointConfig::UpdateConfig()
187 {
188  if (!static_responders_.empty())
189  {
190  config_.static_responders = static_responders_.data();
191  config_.num_static_responders = static_responders_.size();
192  }
193  if (!dynamic_responders_.empty())
194  {
195  config_.dynamic_responders = dynamic_responders_.data();
196  config_.num_dynamic_responders = dynamic_responders_.size();
197  }
198 }
199 
203 {
204 public:
206  uint16_t control_field,
207  rdm::Uid binding_uid = rdm::Uid{});
208 
210 
211 private:
212  RdmnetPhysicalEndpointResponder responder_{};
213 };
214 
220  uint16_t control_field,
221  rdm::Uid binding_uid)
222  : responder_{uid.get(), control_field, binding_uid.get()}
223 {
224 }
225 
228 {
229  return responder_;
230 }
231 
251 {
252 public:
253  PhysicalEndpointConfig(uint16_t id, const PhysicalEndpointResponder* responders = nullptr, size_t num_responders = 0);
254  PhysicalEndpointConfig(uint16_t id, const std::vector<PhysicalEndpointResponder>& responders);
255 
256  const RdmnetPhysicalEndpointConfig& get() const noexcept;
257 
258 private:
259  void UpdateConfig();
260 
263 };
264 
270  const PhysicalEndpointResponder* responders,
271  size_t num_responders)
272  : config_{id, nullptr, 0}
273 {
274  if (responders && num_responders)
275  {
276  std::transform(responders, responders + num_responders, std::back_inserter(responders_),
277  [](const PhysicalEndpointResponder& resp) { return resp.get(); });
278  UpdateConfig();
279  }
280 }
281 
286  const std::vector<PhysicalEndpointResponder>& responders)
287  : config_{id, nullptr, 0}
288 {
289  if (!responders.empty())
290  {
291  std::transform(responders.begin(), responders.end(), std::back_inserter(responders_),
292  [](const PhysicalEndpointResponder& resp) { return resp.get(); });
293  UpdateConfig();
294  }
295 }
296 
299 {
300  return config_;
301 }
302 
303 // Sets the values of the encapsulated config correctly.
304 inline void PhysicalEndpointConfig::UpdateConfig()
305 {
306  config_.responders = responders_.data();
307  config_.num_responders = responders_.size();
308 }
309 
314 class Device
315 {
316 public:
321 
327  {
328  public:
329  virtual ~NotifyHandler() = default;
330 
335 
340 
345 
351 
357 
369  {
370  ETCPAL_UNUSED_ARG(handle);
371  ETCPAL_UNUSED_ARG(list);
372  }
373  };
374 
377  struct Settings
378  {
380  rdm::Uid uid;
382 
385  uint8_t* response_buf{nullptr};
386 
395 
397  Settings() = default;
398  Settings(const etcpal::Uuid& new_cid, const rdm::Uid& new_uid);
399  Settings(const etcpal::Uuid& new_cid, uint16_t manufacturer_id);
400 
401  bool IsValid() const;
402  };
403 
404  Device() = default;
405  Device(const Device& other) = delete;
406  Device& operator=(const Device& other) = delete;
407  Device(Device&& other) = default;
408  Device& operator=(Device&& other) = default;
409 
411  const Settings& settings,
412  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
413  etcpal::Error Startup(NotifyHandler& notify_handler,
414  const Settings& settings,
415  const char* scope_id_str,
416  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
417  etcpal::Error Startup(NotifyHandler& notify_handler, const Settings& settings, const Scope& scope_config);
419 
420  etcpal::Error ChangeScope(const char* new_scope_id_str,
421  rdmnet_disconnect_reason_t disconnect_reason,
422  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
423  etcpal::Error ChangeScope(const Scope& new_scope_config, rdmnet_disconnect_reason_t disconnect_reason);
424  etcpal::Error ChangeSearchDomain(const char* new_search_domain, rdmnet_disconnect_reason_t disconnect_reason);
425 
426  etcpal::Error SendRdmAck(const SavedRdmCommand& received_cmd,
427  const uint8_t* response_data = nullptr,
428  size_t response_data_len = 0);
429  etcpal::Error SendRdmNack(const SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason);
430  etcpal::Error SendRdmNack(const SavedRdmCommand& received_cmd, uint16_t raw_nack_reason);
431  etcpal::Error SendRdmUpdate(uint16_t param_id, const uint8_t* data = nullptr, size_t data_len = 0);
432  etcpal::Error SendRdmUpdate(uint16_t subdevice,
433  uint16_t param_id,
434  const uint8_t* data = nullptr,
435  size_t data_len = 0);
436  etcpal::Error SendRdmUpdate(const SourceAddr& source_addr,
437  uint16_t param_id,
438  const uint8_t* data = nullptr,
439  size_t data_len = 0);
440  etcpal::Error SendRptStatus(const SavedRdmCommand& received_cmd,
441  rpt_status_code_t status_code,
442  const char* status_string = nullptr);
443 
444  etcpal::Error SendLlrpAck(const llrp::SavedRdmCommand& received_cmd,
445  const uint8_t* response_data = nullptr,
446  uint8_t response_data_len = 0);
447  etcpal::Error SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason);
448  etcpal::Error SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, uint16_t raw_nack_reason);
449 
450  etcpal::Error AddVirtualEndpoint(const VirtualEndpointConfig& endpoint_config);
452  etcpal::Error AddPhysicalEndpoint(const PhysicalEndpointConfig& physical_config);
454  etcpal::Error RemoveEndpoint(uint16_t endpoint_id);
456 
457  etcpal::Error AddVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id);
458  etcpal::Error AddVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid);
459  etcpal::Error AddVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids);
460  etcpal::Error AddVirtualResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_static_uids);
461  etcpal::Error AddPhysicalResponder(uint16_t endpoint_id,
462  const rdm::Uid& responder_uid,
463  uint16_t control_field,
464  const rdm::Uid& binding_uid = rdm::Uid{});
465  etcpal::Error AddPhysicalResponder(uint16_t endpoint_id, const PhysicalEndpointResponder& responder);
466  etcpal::Error AddPhysicalResponders(uint16_t endpoint_id, const std::vector<PhysicalEndpointResponder>& responders);
467  etcpal::Error RemoveVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id);
468  etcpal::Error RemoveVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid);
469  etcpal::Error RemoveVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids);
470  etcpal::Error RemoveVirtualResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_static_uids);
471  etcpal::Error RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid& responder_uid);
472  etcpal::Error RemovePhysicalResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_uids);
473 
474  constexpr Handle handle() const;
475  constexpr NotifyHandler* notify_handler() const;
477 
478 private:
479  class TranslatedConfig
480  {
481  public:
482  TranslatedConfig(const Settings& settings,
483  NotifyHandler& notify_handler,
484  const char* scope,
485  const etcpal::SockAddr& static_broker_addr);
486  const RdmnetDeviceConfig& get() noexcept;
487 
488  private:
489  std::vector<RdmnetPhysicalEndpointConfig> physical_endpoints_;
490  std::vector<RdmnetVirtualEndpointConfig> virtual_endpoints_;
491  RdmnetDeviceConfig config_;
492  };
493 
494  Handle handle_{kInvalidHandle};
495  NotifyHandler* notify_{nullptr};
496 };
497 
500 
501 namespace internal
502 {
503 extern "C" inline void DeviceLibCbConnected(rdmnet_device_t handle,
504  const RdmnetClientConnectedInfo* info,
505  void* context)
506 {
507  if (info && context)
508  {
509  static_cast<Device::NotifyHandler*>(context)->HandleConnectedToBroker(handle, *info);
510  }
511 }
512 
513 extern "C" inline void DeviceLibCbConnectFailed(rdmnet_device_t handle,
514  const RdmnetClientConnectFailedInfo* info,
515  void* context)
516 {
517  if (info && context)
518  {
519  static_cast<Device::NotifyHandler*>(context)->HandleBrokerConnectFailed(handle, *info);
520  }
521 }
522 
523 extern "C" inline void DeviceLibCbDisconnected(rdmnet_device_t handle,
524  const RdmnetClientDisconnectedInfo* info,
525  void* context)
526 {
527  if (info && context)
528  {
529  static_cast<Device::NotifyHandler*>(context)->HandleDisconnectedFromBroker(handle, *info);
530  }
531 }
532 
533 extern "C" inline void DeviceLibCbRdmCommandReceived(rdmnet_device_t handle,
534  const RdmnetRdmCommand* cmd,
535  RdmnetSyncRdmResponse* response,
536  void* context)
537 {
538  if (cmd && context)
539  {
540  *response = static_cast<Device::NotifyHandler*>(context)->HandleRdmCommand(handle, *cmd).get();
541  }
542 }
543 
544 extern "C" inline void DeviceLibCbLlrpRdmCommandReceived(rdmnet_device_t handle,
545  const LlrpRdmCommand* cmd,
546  RdmnetSyncRdmResponse* response,
547  void* context)
548 {
549  if (cmd && context)
550  {
551  *response = static_cast<Device::NotifyHandler*>(context)->HandleLlrpRdmCommand(handle, *cmd).get();
552  }
553 }
554 
555 extern "C" inline void DeviceLibCbDynamicUidStatus(rdmnet_device_t handle,
556  const RdmnetDynamicUidAssignmentList* list,
557  void* context)
558 {
559  if (list && context)
560  {
561  static_cast<Device::NotifyHandler*>(context)->HandleDynamicUidStatus(handle, *list);
562  }
563 }
564 
565 }; // namespace internal
566 
568 
573 inline Device::Settings::Settings(const etcpal::Uuid& new_cid, const rdm::Uid& new_uid) : cid(new_cid), uid(new_uid)
574 {
575 }
576 
581 inline Device::Settings::Settings(const etcpal::Uuid& cid_in, uint16_t manufacturer_id)
582  : cid(cid_in), uid(rdm::Uid::DynamicUidRequest(manufacturer_id))
583 {
584 }
585 
587 inline bool Device::Settings::IsValid() const
588 {
589  return (!cid.IsNull() && (uid.IsStatic() || uid.IsDynamicUidRequest()));
590 }
591 
607  const Settings& settings,
608  const etcpal::SockAddr& static_broker_addr)
609 {
610  TranslatedConfig config(settings, notify_handler, E133_DEFAULT_SCOPE, static_broker_addr);
611  return rdmnet_device_create(&config.get(), &handle_);
612 }
613 
630  const Settings& settings,
631  const char* scope_id_str,
632  const etcpal::SockAddr& static_broker_addr)
633 {
634  TranslatedConfig config(settings, notify_handler, scope_id_str, static_broker_addr);
635  return rdmnet_device_create(&config.get(), &handle_);
636 }
637 
651 inline etcpal::Error Device::Startup(NotifyHandler& notify_handler, const Settings& settings, const Scope& scope_config)
652 {
653  TranslatedConfig config(settings, notify_handler, scope_config.id_string().c_str(),
654  scope_config.static_broker_addr());
655  return rdmnet_device_create(&config.get(), &handle_);
656 }
657 
664 inline void Device::Shutdown(rdmnet_disconnect_reason_t disconnect_reason)
665 {
666  rdmnet_device_destroy(handle_, disconnect_reason);
667  handle_ = kInvalidHandle;
668 }
669 
683 inline etcpal::Error Device::ChangeScope(const char* new_scope_id_str,
684  rdmnet_disconnect_reason_t disconnect_reason,
685  const etcpal::SockAddr& static_broker_addr)
686 {
687  RdmnetScopeConfig new_scope_config = {new_scope_id_str, static_broker_addr.get()};
688  return rdmnet_device_change_scope(handle_, &new_scope_config, disconnect_reason);
689 }
690 
702 inline etcpal::Error Device::ChangeScope(const Scope& new_scope_config, rdmnet_disconnect_reason_t disconnect_reason)
703 {
704  RdmnetScopeConfig translated_config = {new_scope_config.id_string().c_str(),
705  new_scope_config.static_broker_addr().get()};
706  return rdmnet_device_change_scope(handle_, &translated_config, disconnect_reason);
707 }
708 
723 inline etcpal::Error Device::ChangeSearchDomain(const char* new_search_domain,
724  rdmnet_disconnect_reason_t disconnect_reason)
725 {
726  return rdmnet_device_change_search_domain(handle_, new_search_domain, disconnect_reason);
727 }
728 
736  const uint8_t* response_data,
737  size_t response_data_len)
738 {
739  return rdmnet_device_send_rdm_ack(handle_, &received_cmd.get(), response_data, response_data_len);
740 }
741 
747 inline etcpal::Error Device::SendRdmNack(const SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason)
748 {
749  return rdmnet_device_send_rdm_nack(handle_, &received_cmd.get(), nack_reason);
750 }
751 
758 inline etcpal::Error Device::SendRdmNack(const SavedRdmCommand& received_cmd, uint16_t raw_nack_reason)
759 {
760  return rdmnet_device_send_rdm_nack(handle_, &received_cmd.get(), static_cast<rdm_nack_reason_t>(raw_nack_reason));
761 }
762 
773 inline etcpal::Error Device::SendRdmUpdate(uint16_t param_id, const uint8_t* data, size_t data_len)
774 {
775  return rdmnet_device_send_rdm_update(handle_, 0, param_id, data, data_len);
776 }
777 
789 inline etcpal::Error Device::SendRdmUpdate(uint16_t subdevice, uint16_t param_id, const uint8_t* data, size_t data_len)
790 {
791  return rdmnet_device_send_rdm_update(handle_, subdevice, param_id, data, data_len);
792 }
793 
808  uint16_t param_id,
809  const uint8_t* data,
810  size_t data_len)
811 {
812  return rdmnet_device_send_rdm_update_from_responder(handle_, &source_addr.get(), param_id, data, data_len);
813 }
814 
827  rpt_status_code_t status_code,
828  const char* status_string)
829 {
830  return rdmnet_device_send_status(handle_, &received_cmd.get(), status_code, status_string);
831 }
832 
840  const uint8_t* response_data,
841  uint8_t response_data_len)
842 {
843  return rdmnet_device_send_llrp_ack(handle_, &received_cmd.get(), response_data, response_data_len);
844 }
845 
851 inline etcpal::Error Device::SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason)
852 {
853  return rdmnet_device_send_llrp_nack(handle_, &received_cmd.get(), nack_reason);
854 }
855 
862 inline etcpal::Error Device::SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, uint16_t raw_nack_reason)
863 {
864  return rdmnet_device_send_llrp_nack(handle_, &received_cmd.get(), static_cast<rdm_nack_reason_t>(raw_nack_reason));
865 }
866 
876 {
877  return rdmnet_device_add_virtual_endpoint(handle_, &endpoint_config.get());
878 }
879 
889 {
890  if (endpoint_configs.empty())
891  return kEtcPalErrInvalid;
892 
894  virtual_endpts.reserve(endpoint_configs.size());
895  std::transform(endpoint_configs.begin(), endpoint_configs.end(), std::back_inserter(virtual_endpts),
896  [](const VirtualEndpointConfig& config) { return config.get(); });
897 
898  return rdmnet_device_add_virtual_endpoints(handle_, virtual_endpts.data(), virtual_endpts.size());
899 }
900 
910 {
911  return rdmnet_device_add_physical_endpoint(handle_, &endpoint_config.get());
912 }
913 
923 {
924  if (endpoint_configs.empty())
925  return kEtcPalErrInvalid;
926 
928  physical_endpts.reserve(endpoint_configs.size());
929  std::transform(endpoint_configs.begin(), endpoint_configs.end(), std::back_inserter(physical_endpts),
930  [](const PhysicalEndpointConfig& config) { return config.get(); });
931 
932  return rdmnet_device_add_physical_endpoints(handle_, physical_endpts.data(), physical_endpts.size());
933 }
934 
943 inline etcpal::Error Device::RemoveEndpoint(uint16_t endpoint_id)
944 {
945  return rdmnet_device_remove_endpoint(handle_, endpoint_id);
946 }
947 
958 {
959  if (endpoint_ids.empty())
960  return kEtcPalErrInvalid;
961 
962  return rdmnet_device_remove_endpoints(handle_, endpoint_ids.data(), endpoint_ids.size());
963 }
964 
980 inline etcpal::Error Device::AddVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id)
981 {
982  return rdmnet_device_add_dynamic_responders(handle_, endpoint_id, &responder_id.get(), 1);
983 }
984 
997 inline etcpal::Error Device::AddVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid)
998 {
999  return rdmnet_device_add_static_responders(handle_, endpoint_id, &responder_static_uid.get(), 1);
1000 }
1001 
1017 inline etcpal::Error Device::AddVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids)
1018 {
1019  if (responder_ids.empty())
1020  return kEtcPalErrInvalid;
1021 
1023  ids.reserve(responder_ids.size());
1024  std::transform(responder_ids.begin(), responder_ids.end(), std::back_inserter(ids),
1025  [](const etcpal::Uuid& id) { return id.get(); });
1026 
1027  return rdmnet_device_add_dynamic_responders(handle_, endpoint_id, ids.data(), ids.size());
1028 }
1029 
1042 inline etcpal::Error Device::AddVirtualResponders(uint16_t endpoint_id,
1043  const std::vector<rdm::Uid>& responder_static_uids)
1044 {
1045  if (responder_static_uids.empty())
1046  return kEtcPalErrInvalid;
1047 
1048  std::vector<RdmUid> uids;
1049  uids.reserve(responder_static_uids.size());
1050  std::transform(responder_static_uids.begin(), responder_static_uids.end(), std::back_inserter(uids),
1051  [](const rdm::Uid& uid) { return uid.get(); });
1052 
1053  return rdmnet_device_add_static_responders(handle_, endpoint_id, uids.data(), uids.size());
1054 }
1055 
1070 inline etcpal::Error Device::AddPhysicalResponder(uint16_t endpoint_id,
1071  const rdm::Uid& responder_uid,
1072  uint16_t control_field,
1073  const rdm::Uid& binding_uid)
1074 {
1075  RdmnetPhysicalEndpointResponder responder = {responder_uid.get(), control_field, binding_uid.get()};
1076  return rdmnet_device_add_physical_responders(handle_, endpoint_id, &responder, 1);
1077 }
1078 
1091 inline etcpal::Error Device::AddPhysicalResponder(uint16_t endpoint_id, const PhysicalEndpointResponder& responder)
1092 {
1093  return rdmnet_device_add_physical_responders(handle_, endpoint_id, &responder.get(), 1);
1094 }
1095 
1108 inline etcpal::Error Device::AddPhysicalResponders(uint16_t endpoint_id,
1109  const std::vector<PhysicalEndpointResponder>& responders)
1110 {
1111  if (responders.empty())
1112  return kEtcPalErrInvalid;
1113 
1115  resps.reserve(responders.size());
1116  std::transform(responders.begin(), responders.end(), std::back_inserter(resps),
1117  [](const PhysicalEndpointResponder& responder) { return responder.get(); });
1118 
1119  return rdmnet_device_add_physical_responders(handle_, endpoint_id, resps.data(), resps.size());
1120 }
1121 
1135 inline etcpal::Error Device::RemoveVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id)
1136 {
1137  return rdmnet_device_remove_dynamic_responders(handle_, endpoint_id, &responder_id.get(), 1);
1138 }
1139 
1153 inline etcpal::Error Device::RemoveVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid)
1154 {
1155  return rdmnet_device_remove_static_responders(handle_, endpoint_id, &responder_static_uid.get(), 1);
1156 }
1157 
1172  const std::vector<etcpal::Uuid>& responder_ids)
1173 {
1174  if (responder_ids.empty())
1175  return kEtcPalErrInvalid;
1176 
1178  ids.reserve(responder_ids.size());
1179  std::transform(responder_ids.begin(), responder_ids.end(), std::back_inserter(ids),
1180  [](const etcpal::Uuid& id) { return id.get(); });
1181 
1182  return rdmnet_device_remove_dynamic_responders(handle_, endpoint_id, ids.data(), ids.size());
1183 }
1184 
1199  const std::vector<rdm::Uid>& responder_static_uids)
1200 {
1201  if (responder_static_uids.empty())
1202  return kEtcPalErrInvalid;
1203 
1204  std::vector<RdmUid> uids;
1205  uids.reserve(responder_static_uids.size());
1206  std::transform(responder_static_uids.begin(), responder_static_uids.end(), std::back_inserter(uids),
1207  [](const rdm::Uid& uid) { return uid.get(); });
1208 
1209  return rdmnet_device_remove_static_responders(handle_, endpoint_id, uids.data(), uids.size());
1210 }
1211 
1225 inline etcpal::Error Device::RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid& responder_uid)
1226 {
1227  return rdmnet_device_remove_physical_responders(handle_, endpoint_id, &responder_uid.get(), 1);
1228 }
1229 
1243 inline etcpal::Error Device::RemovePhysicalResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_uids)
1244 {
1245  if (responder_uids.empty())
1246  return kEtcPalErrInvalid;
1247 
1248  std::vector<RdmUid> uids;
1249  uids.reserve(responder_uids.size());
1250  std::transform(responder_uids.begin(), responder_uids.end(), std::back_inserter(uids),
1251  [](const rdm::Uid& uid) { return uid.get(); });
1252 
1253  return rdmnet_device_remove_physical_responders(handle_, endpoint_id, uids.data(), uids.size());
1254 }
1255 
1258 {
1259  return handle_;
1260 }
1261 
1264 {
1265  return notify_;
1266 }
1267 
1273 {
1274  std::string scope_id(E133_SCOPE_STRING_PADDED_LENGTH, 0);
1275  EtcPalSockAddr static_broker_addr;
1276  etcpal_error_t res = rdmnet_device_get_scope(handle_, &scope_id[0], &static_broker_addr);
1277  if (res == kEtcPalErrOk)
1278  return Scope(scope_id, static_broker_addr);
1279  else
1280  return res;
1281 }
1282 
1283 inline const RdmnetDeviceConfig& Device::TranslatedConfig::get() noexcept
1284 {
1285  if (!physical_endpoints_.empty())
1286  {
1287  config_.physical_endpoints = physical_endpoints_.data();
1288  config_.num_physical_endpoints = physical_endpoints_.size();
1289  }
1290  if (!virtual_endpoints_.empty())
1291  {
1292  config_.virtual_endpoints = virtual_endpoints_.data();
1293  config_.num_virtual_endpoints = virtual_endpoints_.size();
1294  }
1295  return config_;
1296 }
1297 
1298 // clang-format off
1299 inline Device::TranslatedConfig::TranslatedConfig(const Settings& settings,
1300  NotifyHandler& notify_handler,
1301  const char* scope,
1302  const etcpal::SockAddr& static_broker_addr)
1303  : config_{
1304  settings.cid.get(),
1305  {
1306  ::rdmnet::internal::DeviceLibCbConnected,
1307  ::rdmnet::internal::DeviceLibCbConnectFailed,
1308  ::rdmnet::internal::DeviceLibCbDisconnected,
1309  ::rdmnet::internal::DeviceLibCbRdmCommandReceived,
1310  ::rdmnet::internal::DeviceLibCbLlrpRdmCommandReceived,
1311  ::rdmnet::internal::DeviceLibCbDynamicUidStatus,
1313  },
1314  settings.response_buf,
1315  {
1316  scope,
1317  static_broker_addr.get()
1318  },
1319  settings.uid.get(),
1320  settings.search_domain.c_str(),
1321  nullptr,
1322  0,
1323  nullptr,
1324  0,
1325  nullptr,
1326  0
1327  }
1328 {
1329  // clang-format on
1330 
1331  // Physical endpoints
1332  if (!settings.physical_endpoints.empty())
1333  {
1334  physical_endpoints_.reserve(settings.physical_endpoints.size());
1335  std::transform(settings.physical_endpoints.begin(), settings.physical_endpoints.end(),
1336  std::back_inserter(physical_endpoints_),
1337  [](const PhysicalEndpointConfig& config) { return config.get(); });
1338  }
1339 
1340  // Virtual endpoints
1341  if (!settings.virtual_endpoints.empty())
1342  {
1343  virtual_endpoints_.reserve(settings.virtual_endpoints.size());
1344  std::transform(settings.virtual_endpoints.begin(), settings.virtual_endpoints.end(),
1345  std::back_inserter(virtual_endpoints_),
1346  [](const VirtualEndpointConfig& config) { return config.get(); });
1347  }
1348 
1349  // LLRP network interfaces
1350  if (!settings.llrp_netints.empty())
1351  {
1352  config_.llrp_netints = settings.llrp_netints.data();
1353  config_.num_llrp_netints = settings.llrp_netints.size();
1354  }
1355 }
1356 
1357 }; // namespace rdmnet
1358 
1359 #endif // RDMNET_CPP_DEVICE_H_
T back_inserter(T... args)
T begin(T... args)
T c_str(T... args)
constexpr const EtcPalSockAddr & get() const noexcept
constexpr const EtcPalUuid & get() const noexcept
Information about a failed connection to a broker delivered to an RDMnet callback function.
Definition: client.h:219
Information about a successful connection to a broker delivered to an RDMnet callback function.
Definition: client.h:149
Information about a disconnect event from a broker delivered to an RDMnet callback function.
Definition: client.h:337
A base class for a class that receives notification callbacks from a device.
Definition: device.h:327
virtual void HandleBrokerConnectFailed(Handle handle, const ClientConnectFailedInfo &info)=0
A connection attempt failed between a device and a broker.
virtual void HandleConnectedToBroker(Handle handle, const ClientConnectedInfo &info)=0
A device has successfully connected to a broker.
virtual void HandleDisconnectedFromBroker(Handle handle, const ClientDisconnectedInfo &info)=0
A device which was previously connected to a broker has disconnected.
virtual void HandleDynamicUidStatus(Handle handle, const DynamicUidAssignmentList &list)
The dynamic UID assignment status for a set of virtual responders has been received.
Definition: device.h:368
virtual RdmResponseAction HandleLlrpRdmCommand(Handle handle, const llrp::RdmCommand &cmd)=0
An RDM command has been received over LLRP, addressed to a device.
virtual RdmResponseAction HandleRdmCommand(Handle handle, const RdmCommand &cmd)=0
An RDM command has been received addressed to a device.
An instance of RDMnet device functionality.
Definition: device.h:315
etcpal::Error RemoveEndpoints(const std::vector< uint16_t > &endpoint_ids)
Remove multiple endpoints from a device.
Definition: device.h:957
etcpal::Error RemoveEndpoint(uint16_t endpoint_id)
Remove an endpoint from a device.
Definition: device.h:943
etcpal::Error AddPhysicalResponders(uint16_t endpoint_id, const std::vector< PhysicalEndpointResponder > &responders)
Add multiple responders to a physical endpoint.
Definition: device.h:1108
etcpal::Error RemovePhysicalResponders(uint16_t endpoint_id, const std::vector< rdm::Uid > &responder_uids)
Remove multiple responders from a physical endpoint.
Definition: device.h:1243
Device(Device &&other)=default
Move a device instance.
etcpal::Error AddPhysicalEndpoints(const std::vector< PhysicalEndpointConfig > &endpoint_configs)
Add multiple physical endpoints to a device.
Definition: device.h:922
etcpal::Error RemoveVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid &responder_id)
Remove a responder with a dynamic UID from a virtual endpoint.
Definition: device.h:1135
Device & operator=(Device &&other)=default
Move a device instance.
etcpal::Error RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid &responder_uid)
Remove a responder from a physical endpoint.
Definition: device.h:1225
etcpal::Expected< Scope > scope() const
Retrieve the scope configuration associated with a device instance.
Definition: device.h:1272
etcpal::Error SendLlrpNack(const llrp::SavedRdmCommand &received_cmd, rdm_nack_reason_t nack_reason)
Send a negative acknowledge (NACK) response to an RDM command received by a device over LLRP.
Definition: device.h:851
etcpal::Error SendRdmAck(const SavedRdmCommand &received_cmd, const uint8_t *response_data=nullptr, size_t response_data_len=0)
Send an acknowledge (ACK) response to an RDM command received by a device.
Definition: device.h:735
etcpal::Error AddVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid &responder_id)
Add a responder with a dynamic UID to a virtual endpoint.
Definition: device.h:980
constexpr NotifyHandler * notify_handler() const
Retrieve the NotifyHandler reference that this device was configured with.
Definition: device.h:1263
rdmnet_device_t Handle
A handle type used by the RDMnet library to identify device instances.
Definition: device.h:318
etcpal::Error ChangeSearchDomain(const char *new_search_domain, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's DNS search domain.
Definition: device.h:723
void Shutdown(rdmnet_disconnect_reason_t disconnect_reason=kRdmnetDisconnectShutdown)
Shut down this device and deallocate resources.
Definition: device.h:664
etcpal::Error AddPhysicalEndpoint(const PhysicalEndpointConfig &physical_config)
Add a physical endpoint to a device.
Definition: device.h:909
constexpr Handle handle() const
Retrieve the handle of a device instance.
Definition: device.h:1257
etcpal::Error AddVirtualEndpoint(const VirtualEndpointConfig &endpoint_config)
Add a virtual endpoint to a device.
Definition: device.h:875
etcpal::Error ChangeScope(const char *new_scope_id_str, rdmnet_disconnect_reason_t disconnect_reason, const etcpal::SockAddr &static_broker_addr=etcpal::SockAddr{})
Change the device's RDMnet scope.
Definition: device.h:683
etcpal::Error AddVirtualEndpoints(const std::vector< VirtualEndpointConfig > &endpoint_configs)
Add multiple virtual endpoints to a device.
Definition: device.h:888
etcpal::Error RemoveVirtualResponders(uint16_t endpoint_id, const std::vector< etcpal::Uuid > &responder_ids)
Remove multiple responder with dynamic UIDs from a virtual endpoint.
Definition: device.h:1171
etcpal::Error AddPhysicalResponder(uint16_t endpoint_id, const rdm::Uid &responder_uid, uint16_t control_field, const rdm::Uid &binding_uid=rdm::Uid{})
Add a responder to a physical endpoint.
Definition: device.h:1070
etcpal::Error SendLlrpAck(const llrp::SavedRdmCommand &received_cmd, const uint8_t *response_data=nullptr, uint8_t response_data_len=0)
Send an acknowledge (ACK) response to an RDM command received by a device over LLRP.
Definition: device.h:839
etcpal::Error Startup(NotifyHandler &notify_handler, const Settings &settings, const char *scope_id_str, const etcpal::SockAddr &static_broker_addr=etcpal::SockAddr{})
Allocate resources and start up this device with the given configuration on the given RDMnet scope.
Definition: device.h:629
etcpal::Error AddVirtualResponders(uint16_t endpoint_id, const std::vector< etcpal::Uuid > &responder_ids)
Add multiple responders with dynamic UIDs to a virtual endpoint.
Definition: device.h:1017
etcpal::Error SendRptStatus(const SavedRdmCommand &received_cmd, rpt_status_code_t status_code, const char *status_string=nullptr)
Send an RPT status message from a device.
Definition: device.h:826
static constexpr Handle kInvalidHandle
An invalid Handle value.
Definition: device.h:320
etcpal::Error SendRdmNack(const SavedRdmCommand &received_cmd, rdm_nack_reason_t nack_reason)
Send a negative acknowledge (NACK) response to an RDM command received by a device.
Definition: device.h:747
etcpal::Error SendRdmUpdate(uint16_t param_id, const uint8_t *data=nullptr, size_t data_len=0)
Send an asynchronous RDM GET response to update the value of a local parameter.
Definition: device.h:773
etcpal::Error StartupWithDefaultScope(NotifyHandler &notify_handler, const Settings &settings, const etcpal::SockAddr &static_broker_addr=etcpal::SockAddr{})
Allocate resources and start up this device with the given configuration on the default RDMnet scope.
Definition: device.h:606
A list of mappings from dynamic UIDs to responder IDs received from an RDMnet broker.
Definition: dynamic_uid.h:98
Configuration information for a physical endpoint on a device.
Definition: device.h:251
const RdmnetPhysicalEndpointConfig & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:298
PhysicalEndpointConfig(uint16_t id, const PhysicalEndpointResponder *responders=nullptr, size_t num_responders=0)
Create a physical endpoint configuration with an optional set of RDM responders.
Definition: device.h:269
Identifying information for a physical RDM responder connected to an RDMnet gateway.
Definition: device.h:203
ETCPAL_CONSTEXPR_14 PhysicalEndpointResponder(rdm::Uid uid, uint16_t control_field, rdm::Uid binding_uid=rdm::Uid{})
Create a physical endpoint responder from its identifying information.
Definition: device.h:219
ETCPAL_CONSTEXPR_14 const RdmnetPhysicalEndpointResponder & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:227
An RDM command received over RDMnet and delivered to an RDMnet callback function.
Definition: rdm_command.h:43
A class representing a synchronous action to take in response to a received RDM command.
Definition: common.h:106
An RDM command received over RDMnet by a local component and saved for a later response.
Definition: rdm_command.h:87
ETCPAL_CONSTEXPR_14 RdmnetSavedRdmCommand & get() noexcept
Get a mutable reference to the underlying C type.
Definition: rdm_command.h:374
An RDMnet scope configuration.
Definition: client.h:460
const etcpal::SockAddr & static_broker_addr() const noexcept
The static broker address associated with this scope.
Definition: client.h:515
const std::string & id_string() const noexcept
The ID string of this scope.
Definition: client.h:506
The source address for an unsolicited RDM response generated by a local component.
Definition: client.h:39
constexpr const RdmnetSourceAddr & get() const noexcept
Get a const reference to the underlying C type.
Definition: client.h:52
Configuration information for a virtual endpoint on a device.
Definition: device.h:71
const RdmnetVirtualEndpointConfig & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:180
VirtualEndpointConfig(uint16_t id, const etcpal::Uuid *dynamic_responders=nullptr, size_t num_dynamic_responders=0)
Create a virtual endpoint configuration with an optional set of virtual responders with dynamic UIDs.
Definition: device.h:100
An RDM command received over LLRP and delivered to an RDMnet callback function.
Definition: llrp_rdm_command.h:46
An RDM command received over LLRP by a local component and saved for a later response.
Definition: llrp_rdm_command.h:91
ETCPAL_CONSTEXPR_14 LlrpSavedRdmCommand & get() noexcept
Get a mutable reference to the underlying C type.
Definition: llrp_rdm_command.h:391
C++ wrapper for RDMnet client API definitions.
C++ wrapper for the RDMnet init/deinit functions.
RDMnet C++ message type definitions.
T data(T... args)
Definitions for the RDMnet Device API.
T empty(T... args)
T end(T... args)
#define ETCPAL_CONSTEXPR_14
#define ETCPAL_CONSTEXPR_14_OR_INLINE
etcpal_error_t
kEtcPalErrInvalid
kEtcPalErrOk
rdmnet_disconnect_reason_t
Disconnect reason defines for the BrokerDisconnectMsg.
Definition: common.h:85
rpt_status_code_t
RPT status code definitions.
Definition: common.h:53
@ kRdmnetDisconnectShutdown
The remote component is shutting down.
Definition: common.h:87
etcpal_error_t rdmnet_device_remove_endpoint(rdmnet_device_t handle, uint16_t endpoint_id)
Remove an endpoint from a device.
Definition: device.c:656
etcpal_error_t rdmnet_device_add_static_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Add one or more responders with static UIDs to a virtual endpoint.
Definition: device.c:728
etcpal_error_t rdmnet_device_destroy(rdmnet_device_t handle, rdmnet_disconnect_reason_t disconnect_reason)
Destroy a device instance.
Definition: device.c:257
etcpal_error_t rdmnet_device_send_rdm_nack(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, rdm_nack_reason_t nack_reason)
Send an RDM NACK response from a device.
Definition: device.c:316
etcpal_error_t rdmnet_device_remove_physical_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Remove one or more responders from a physical endpoint.
Definition: device.c:1073
etcpal_error_t rdmnet_device_add_physical_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmnetPhysicalEndpointResponder *responders, size_t num_responders)
Add one or more responders to a physical endpoint.
Definition: device.c:856
#define RDMNET_DEVICE_INVALID
An invalid RDMnet device handle value.
Definition: device.h:55
etcpal_error_t rdmnet_device_send_rdm_update_from_responder(rdmnet_device_t handle, const RdmnetSourceAddr *source_addr, uint16_t param_id, const uint8_t *data, size_t data_len)
Send an asynchronous RDM GET response to update the value of a parameter on a sub-responder.
Definition: device.c:386
etcpal_error_t rdmnet_device_change_scope(rdmnet_device_t handle, const RdmnetScopeConfig *new_scope_config, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's scope.
Definition: device.c:1154
etcpal_error_t rdmnet_device_add_physical_endpoint(rdmnet_device_t handle, const RdmnetPhysicalEndpointConfig *endpoint_config)
Add a physical endpoint to a device.
Definition: device.c:512
etcpal_error_t rdmnet_device_send_rdm_update(rdmnet_device_t handle, uint16_t subdevice, uint16_t param_id, const uint8_t *data, size_t data_len)
Send an asynchronous RDM GET response to update the value of a local parameter.
Definition: device.c:352
etcpal_error_t rdmnet_device_add_physical_endpoints(rdmnet_device_t handle, const RdmnetPhysicalEndpointConfig *endpoint_configs, size_t num_endpoints)
Add multiple physical endpoints to a device.
Definition: device.c:548
etcpal_error_t rdmnet_device_remove_static_responders(rdmnet_device_t handle, uint16_t endpoint_id, const RdmUid *responder_uids, size_t num_responders)
Remove one or more responders with static UIDs from a virtual endpoint.
Definition: device.c:920
etcpal_error_t rdmnet_device_add_virtual_endpoints(rdmnet_device_t handle, const RdmnetVirtualEndpointConfig *endpoint_configs, size_t num_endpoints)
Add multiple virtual endpoints to a device.
Definition: device.c:620
etcpal_error_t rdmnet_device_add_virtual_endpoint(rdmnet_device_t handle, const RdmnetVirtualEndpointConfig *endpoint_config)
Add a virtual endpoint to a device.
Definition: device.c:584
etcpal_error_t rdmnet_device_send_llrp_nack(rdmnet_device_t handle, const LlrpSavedRdmCommand *received_cmd, rdm_nack_reason_t nack_reason)
Send an ACK response to an RDM command received over LLRP.
Definition: device.c:483
etcpal_error_t rdmnet_device_change_search_domain(rdmnet_device_t handle, const char *new_search_domain, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's DNS search domain.
Definition: device.c:1189
etcpal_error_t rdmnet_device_send_llrp_ack(rdmnet_device_t handle, const LlrpSavedRdmCommand *received_cmd, const uint8_t *response_data, uint8_t response_data_len)
Send an ACK response to an RDM command received over LLRP.
Definition: device.c:453
etcpal_error_t rdmnet_device_add_dynamic_responders(rdmnet_device_t handle, uint16_t endpoint_id, const EtcPalUuid *responder_ids, size_t num_responders)
Add one or more responders with dynamic UIDs to a virtual endpoint.
Definition: device.c:792
etcpal_error_t rdmnet_device_send_rdm_ack(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, const uint8_t *response_data, size_t response_data_len)
Send an RDM ACK response from a device.
Definition: device.c:286
int rdmnet_device_t
A handle to an RDMnet device.
Definition: device.h:53
etcpal_error_t rdmnet_device_get_scope(rdmnet_device_t handle, char *scope_str_buf, EtcPalSockAddr *static_broker_addr)
Retrieve the device's current scope configuration.
Definition: device.c:1222
etcpal_error_t rdmnet_device_create(const RdmnetDeviceConfig *config, rdmnet_device_t *handle)
Create a new instance of RDMnet device functionality.
Definition: device.c:219
etcpal_error_t rdmnet_device_remove_endpoints(rdmnet_device_t handle, const uint16_t *endpoint_ids, size_t num_endpoints)
Remove multiple endpoints from a device.
Definition: device.c:688
etcpal_error_t rdmnet_device_remove_dynamic_responders(rdmnet_device_t handle, uint16_t endpoint_id, const EtcPalUuid *responder_ids, size_t num_responders)
Remove one or more responders with dynamic UIDs from a virtual endpoint.
Definition: device.c:1002
etcpal_error_t rdmnet_device_send_status(rdmnet_device_t handle, const RdmnetSavedRdmCommand *received_cmd, rpt_status_code_t status_code, const char *status_string)
Send an RPT status message from a device.
Definition: device.c:422
T internal(T... args)
A namespace which contains all C++ language definitions in the RDMnet library.
Definition: broker.h:45
T reserve(T... args)
T size(T... args)
An RDM command received from a remote LLRP Manager.
Definition: message.h:439
Information provided by the library about an unsuccessful RDMnet client connection.
Definition: client.h:164
Information provided by the library about a successful RDMnet client connection.
Definition: client.h:151
Information provided by the library about an RDMnet client connection that disconnected after a succe...
Definition: client.h:196
A set of information that defines the startup parameters of an RDMnet Device.
Definition: device.h:227
const RdmnetPhysicalEndpointConfig * physical_endpoints
An array of initial physical endpoints that the device uses.
Definition: device.h:267
A list of mappings from dynamic UIDs to responder IDs received from an RDMnet broker.
Definition: message.h:245
Configuration information for a physical endpoint on a device.
Definition: device.h:198
size_t num_responders
Size of the responders array.
Definition: device.h:204
const RdmnetPhysicalEndpointResponder * responders
An array of initial physical RDM responders on this endpoint, identified by static UID.
Definition: device.h:202
Identifying information for a physical RDM responder connected to an RDMnet gateway.
Definition: device.h:181
An RDMnet RDM command received by this component.
Definition: message.h:53
A set of configuration information for a single scope in which an RDMnet client is participating.
Definition: client.h:224
This structure should not be manipulated directly - use the macros to access it:
Definition: common.h:214
Configuration information for a virtual endpoint on a device.
Definition: device.h:145
const EtcPalUuid * dynamic_responders
An array of initial virtual RDM responders on this endpoint, identified by RID.
Definition: device.h:152
size_t num_static_responders
Size of the static_responders array.
Definition: device.h:158
size_t num_dynamic_responders
Size of the dynamic_responders array.
Definition: device.h:154
const RdmUid * static_responders
An array of initial virtual RDM responders on this endpoint, identified by static UID.
Definition: device.h:156
A set of configuration settings that a device needs to initialize.
Definition: device.h:378
uint8_t * response_buf
A data buffer to be used to respond synchronously to RDM commands.
Definition: device.h:385
bool IsValid() const
Determine whether a device Settings instance contains valid data for RDMnet operation.
Definition: device.h:587
std::vector< RdmnetMcastNetintId > llrp_netints
(optional) A set of network interfaces to use for the LLRP target associated with this device.
Definition: device.h:394
rdm::Uid uid
The device's RDM UID. For a dynamic UID, use rdm::Uid::DynamicUidRequest().
Definition: device.h:380
std::string search_domain
The device's search domain for discovering brokers.
Definition: device.h:381
etcpal::Uuid cid
The device's Component Identifier (CID).
Definition: device.h:379
Settings()=default
Create an empty, invalid data structure by default.
std::vector< VirtualEndpointConfig > virtual_endpoints
Array of configurations for virtual endpoints that are present on the device at startup.
Definition: device.h:388
std::vector< PhysicalEndpointConfig > physical_endpoints
Array of configurations for physical endpoints that are present on the device at startup.
Definition: device.h:390
T transform(T... args)