RDMnet  HEAD (unstable)
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 "etcpal/cpp/opaque_id.h"
35 #include "rdm/cpp/uid.h"
36 #include "rdmnet/device.h"
37 #include "rdmnet/cpp/common.h"
38 #include "rdmnet/cpp/client.h"
39 #include "rdmnet/cpp/message.h"
40 
41 namespace rdmnet
42 {
52 
53 namespace detail
54 {
56 {
57 };
58 }; // namespace detail
59 
79 {
80 public:
81  VirtualEndpointConfig(uint16_t id,
82  const etcpal::Uuid* dynamic_responders = nullptr,
83  size_t num_dynamic_responders = 0);
84  VirtualEndpointConfig(uint16_t id, const std::vector<etcpal::Uuid>& dynamic_responders);
85  VirtualEndpointConfig(uint16_t id,
86  const rdm::Uid* static_responders,
87  size_t num_static_responders,
88  const etcpal::Uuid* dynamic_responders = nullptr,
89  size_t num_dynamic_responders = 0);
90  VirtualEndpointConfig(uint16_t id,
91  const std::vector<rdm::Uid>& static_responders,
92  const std::vector<etcpal::Uuid>& dynamic_responders = std::vector<etcpal::Uuid>{});
93 
94  const RdmnetVirtualEndpointConfig& get() const noexcept;
95 
96 private:
97  void UpdateConfig();
98 
99  std::vector<EtcPalUuid> dynamic_responders_;
100  std::vector<RdmUid> static_responders_;
102 };
103 
110  const etcpal::Uuid* dynamic_responders,
111  size_t num_dynamic_responders)
112  : config_{id, nullptr, 0, nullptr, 0}
113 {
114  if (dynamic_responders && num_dynamic_responders)
115  {
116  std::transform(dynamic_responders, dynamic_responders + num_dynamic_responders,
117  std::back_inserter(dynamic_responders_), [](const etcpal::Uuid& rid) { return rid.get(); });
118  }
119  UpdateConfig();
120 }
121 
125 inline VirtualEndpointConfig::VirtualEndpointConfig(uint16_t id, const std::vector<etcpal::Uuid>& dynamic_responders)
126  : config_{id, nullptr, 0, nullptr, 0}
127 {
128  if (!dynamic_responders.empty())
129  {
130  std::transform(dynamic_responders.begin(), dynamic_responders.end(), std::back_inserter(dynamic_responders_),
131  [](const etcpal::Uuid& rid) { return rid.get(); });
132  }
133  UpdateConfig();
134 }
135 
145  const rdm::Uid* static_responders,
146  size_t num_static_responders,
147  const etcpal::Uuid* dynamic_responders,
148  size_t num_dynamic_responders)
149  : config_{id, nullptr, 0, nullptr, 0}
150 {
151  if (static_responders && num_static_responders)
152  {
153  std::transform(static_responders, static_responders + num_static_responders, std::back_inserter(static_responders_),
154  [](const rdm::Uid& uid) { return uid.get(); });
155  }
156  if (dynamic_responders && num_dynamic_responders)
157  {
158  std::transform(dynamic_responders, dynamic_responders + num_dynamic_responders,
159  std::back_inserter(dynamic_responders_), [](const etcpal::Uuid& rid) { return rid.get(); });
160  }
161  UpdateConfig();
162 }
163 
171  const std::vector<rdm::Uid>& static_responders,
172  const std::vector<etcpal::Uuid>& dynamic_responders)
173  : config_{id, nullptr, 0, nullptr, 0}
174 {
175  if (!static_responders.empty())
176  {
177  std::transform(static_responders.begin(), static_responders.end(), std::back_inserter(static_responders_),
178  [](const rdm::Uid& uid) { return uid.get(); });
179  }
180  if (!dynamic_responders.empty())
181  {
182  std::transform(dynamic_responders.begin(), dynamic_responders.end(), std::back_inserter(dynamic_responders_),
183  [](const etcpal::Uuid& rid) { return rid.get(); });
184  }
185  UpdateConfig();
186 }
187 
190 {
191  return config_;
192 }
193 
194 // Sets the values of the encapsulated config correctly.
195 inline void VirtualEndpointConfig::UpdateConfig()
196 {
197  if (!static_responders_.empty())
198  {
199  config_.static_responders = static_responders_.data();
200  config_.num_static_responders = static_responders_.size();
201  }
202  if (!dynamic_responders_.empty())
203  {
204  config_.dynamic_responders = dynamic_responders_.data();
205  config_.num_dynamic_responders = dynamic_responders_.size();
206  }
207 }
208 
212 {
213 public:
215  uint16_t control_field,
216  rdm::Uid binding_uid = rdm::Uid{});
217 
219 
220 private:
221  RdmnetPhysicalEndpointResponder responder_{};
222 };
223 
229  uint16_t control_field,
230  rdm::Uid binding_uid)
231  : responder_{uid.get(), control_field, binding_uid.get()}
232 {
233 }
234 
237 {
238  return responder_;
239 }
240 
260 {
261 public:
262  PhysicalEndpointConfig(uint16_t id, const PhysicalEndpointResponder* responders = nullptr, size_t num_responders = 0);
263  PhysicalEndpointConfig(uint16_t id, const std::vector<PhysicalEndpointResponder>& responders);
264 
265  const RdmnetPhysicalEndpointConfig& get() const noexcept;
266 
267 private:
268  void UpdateConfig();
269 
272 };
273 
279  const PhysicalEndpointResponder* responders,
280  size_t num_responders)
281  : config_{id, nullptr, 0}
282 {
283  if (responders && num_responders)
284  {
285  std::transform(responders, responders + num_responders, std::back_inserter(responders_),
286  [](const PhysicalEndpointResponder& resp) { return resp.get(); });
287  UpdateConfig();
288  }
289 }
290 
295  const std::vector<PhysicalEndpointResponder>& responders)
296  : config_{id, nullptr, 0}
297 {
298  if (!responders.empty())
299  {
300  std::transform(responders.begin(), responders.end(), std::back_inserter(responders_),
301  [](const PhysicalEndpointResponder& resp) { return resp.get(); });
302  UpdateConfig();
303  }
304 }
305 
308 {
309  return config_;
310 }
311 
312 // Sets the values of the encapsulated config correctly.
313 inline void PhysicalEndpointConfig::UpdateConfig()
314 {
315  config_.responders = responders_.data();
316  config_.num_responders = responders_.size();
317 }
318 
323 class Device
324 {
325 public:
328 
334  {
335  public:
336  virtual ~NotifyHandler() = default;
337 
342 
347 
352 
358 
364 
376  {
377  ETCPAL_UNUSED_ARG(handle);
378  ETCPAL_UNUSED_ARG(list);
379  }
380  };
381 
387  struct Settings
388  {
390  rdm::Uid uid;
392 
395  uint8_t* response_buf{nullptr};
396 
401 
403  Settings() = default;
404  Settings(const etcpal::Uuid& new_cid, const rdm::Uid& new_uid);
405  Settings(const etcpal::Uuid& new_cid, uint16_t manufacturer_id);
406 
407  bool IsValid() const;
408  };
409 
410  Device() = default;
411  Device(const Device& other) = delete;
412  Device& operator=(const Device& other) = delete;
413  Device(Device&& other) = default;
414  Device& operator=(Device&& other) = default;
415 
417  const Settings& settings,
418  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
419  etcpal::Error Startup(NotifyHandler& notify_handler,
420  const Settings& settings,
421  const char* scope_id_str,
422  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
423  etcpal::Error Startup(NotifyHandler& notify_handler, const Settings& settings, const Scope& scope_config);
425 
426  etcpal::Error ChangeScope(const char* new_scope_id_str,
427  rdmnet_disconnect_reason_t disconnect_reason,
428  const etcpal::SockAddr& static_broker_addr = etcpal::SockAddr{});
429  etcpal::Error ChangeScope(const Scope& new_scope_config, rdmnet_disconnect_reason_t disconnect_reason);
430  etcpal::Error ChangeSearchDomain(const char* new_search_domain, rdmnet_disconnect_reason_t disconnect_reason);
431 
432  etcpal::Error SendRdmAck(const SavedRdmCommand& received_cmd,
433  const uint8_t* response_data = nullptr,
434  size_t response_data_len = 0);
435  etcpal::Error SendRdmNack(const SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason);
436  etcpal::Error SendRdmNack(const SavedRdmCommand& received_cmd, uint16_t raw_nack_reason);
437  etcpal::Error SendRdmUpdate(uint16_t param_id, const uint8_t* data = nullptr, size_t data_len = 0);
438  etcpal::Error SendRdmUpdate(uint16_t subdevice,
439  uint16_t param_id,
440  const uint8_t* data = nullptr,
441  size_t data_len = 0);
442  etcpal::Error SendRdmUpdate(const SourceAddr& source_addr,
443  uint16_t param_id,
444  const uint8_t* data = nullptr,
445  size_t data_len = 0);
446  etcpal::Error SendRptStatus(const SavedRdmCommand& received_cmd,
447  rpt_status_code_t status_code,
448  const char* status_string = nullptr);
449 
450  etcpal::Error SendLlrpAck(const llrp::SavedRdmCommand& received_cmd,
451  const uint8_t* response_data = nullptr,
452  uint8_t response_data_len = 0);
453  etcpal::Error SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason);
454  etcpal::Error SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, uint16_t raw_nack_reason);
455 
456  etcpal::Error AddVirtualEndpoint(const VirtualEndpointConfig& endpoint_config);
458  etcpal::Error AddPhysicalEndpoint(const PhysicalEndpointConfig& physical_config);
460  etcpal::Error RemoveEndpoint(uint16_t endpoint_id);
462 
463  etcpal::Error AddVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id);
464  etcpal::Error AddVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid);
465  etcpal::Error AddVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids);
466  etcpal::Error AddVirtualResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_static_uids);
467  etcpal::Error AddPhysicalResponder(uint16_t endpoint_id,
468  const rdm::Uid& responder_uid,
469  uint16_t control_field,
470  const rdm::Uid& binding_uid = rdm::Uid{});
471  etcpal::Error AddPhysicalResponder(uint16_t endpoint_id, const PhysicalEndpointResponder& responder);
472  etcpal::Error AddPhysicalResponders(uint16_t endpoint_id, const std::vector<PhysicalEndpointResponder>& responders);
473  etcpal::Error RemoveVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id);
474  etcpal::Error RemoveVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid);
475  etcpal::Error RemoveVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids);
476  etcpal::Error RemoveVirtualResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_static_uids);
477  etcpal::Error RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid& responder_uid);
478  etcpal::Error RemovePhysicalResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_uids);
479 
480  constexpr Handle handle() const;
481  constexpr NotifyHandler* notify_handler() const;
483 
484 private:
485  class TranslatedConfig
486  {
487  public:
488  TranslatedConfig(const Settings& settings,
489  NotifyHandler& notify_handler,
490  const char* scope,
491  const etcpal::SockAddr& static_broker_addr);
492  const RdmnetDeviceConfig& get() noexcept;
493 
494  private:
495  std::vector<RdmnetPhysicalEndpointConfig> physical_endpoints_;
496  std::vector<RdmnetVirtualEndpointConfig> virtual_endpoints_;
497  RdmnetDeviceConfig config_;
498  };
499 
500  Handle handle_;
501  NotifyHandler* notify_{nullptr};
502 };
503 
506 
507 namespace internal
508 {
509 extern "C" inline void DeviceLibCbConnected(rdmnet_device_t handle,
510  const RdmnetClientConnectedInfo* info,
511  void* context)
512 {
513  if (info && context)
514  {
515  static_cast<Device::NotifyHandler*>(context)->HandleConnectedToBroker(Device::Handle(handle), *info);
516  }
517 }
518 
519 extern "C" inline void DeviceLibCbConnectFailed(rdmnet_device_t handle,
520  const RdmnetClientConnectFailedInfo* info,
521  void* context)
522 {
523  if (info && context)
524  {
525  static_cast<Device::NotifyHandler*>(context)->HandleBrokerConnectFailed(Device::Handle(handle), *info);
526  }
527 }
528 
529 extern "C" inline void DeviceLibCbDisconnected(rdmnet_device_t handle,
530  const RdmnetClientDisconnectedInfo* info,
531  void* context)
532 {
533  if (info && context)
534  {
535  static_cast<Device::NotifyHandler*>(context)->HandleDisconnectedFromBroker(Device::Handle(handle), *info);
536  }
537 }
538 
539 extern "C" inline void DeviceLibCbRdmCommandReceived(rdmnet_device_t handle,
540  const RdmnetRdmCommand* cmd,
541  RdmnetSyncRdmResponse* response,
542  void* context)
543 {
544  if (cmd && response && context)
545  {
546  *response = static_cast<Device::NotifyHandler*>(context)->HandleRdmCommand(Device::Handle(handle), *cmd).get();
547  }
548 }
549 
550 extern "C" inline void DeviceLibCbLlrpRdmCommandReceived(rdmnet_device_t handle,
551  const LlrpRdmCommand* cmd,
552  RdmnetSyncRdmResponse* response,
553  void* context)
554 {
555  if (cmd && response && context)
556  {
557  *response = static_cast<Device::NotifyHandler*>(context)->HandleLlrpRdmCommand(Device::Handle(handle), *cmd).get();
558  }
559 }
560 
561 extern "C" inline void DeviceLibCbDynamicUidStatus(rdmnet_device_t handle,
562  const RdmnetDynamicUidAssignmentList* list,
563  void* context)
564 {
565  if (list && context)
566  {
567  static_cast<Device::NotifyHandler*>(context)->HandleDynamicUidStatus(Device::Handle(handle), *list);
568  }
569 }
570 
571 }; // namespace internal
572 
574 
579 inline Device::Settings::Settings(const etcpal::Uuid& new_cid, const rdm::Uid& new_uid) : cid(new_cid), uid(new_uid)
580 {
581 }
582 
587 inline Device::Settings::Settings(const etcpal::Uuid& cid_in, uint16_t manufacturer_id)
588  : cid(cid_in), uid(rdm::Uid::DynamicUidRequest(manufacturer_id))
589 {
590 }
591 
593 inline bool Device::Settings::IsValid() const
594 {
595  return (!cid.IsNull() && (uid.IsStatic() || uid.IsDynamicUidRequest()));
596 }
597 
613  const Settings& settings,
614  const etcpal::SockAddr& static_broker_addr)
615 {
616  TranslatedConfig config(settings, notify_handler, E133_DEFAULT_SCOPE, static_broker_addr);
617 
619  etcpal::Error result = rdmnet_device_create(&config.get(), &c_handle);
620 
621  handle_.SetValue(c_handle);
622 
623  return result;
624 }
625 
642  const Settings& settings,
643  const char* scope_id_str,
644  const etcpal::SockAddr& static_broker_addr)
645 {
646  if (!scope_id_str)
647  return kEtcPalErrInvalid;
648 
649  TranslatedConfig config(settings, notify_handler, scope_id_str, static_broker_addr);
650 
652  etcpal::Error result = rdmnet_device_create(&config.get(), &c_handle);
653 
654  handle_.SetValue(c_handle);
655 
656  return result;
657 }
658 
672 inline etcpal::Error Device::Startup(NotifyHandler& notify_handler, const Settings& settings, const Scope& scope_config)
673 {
674  TranslatedConfig config(settings, notify_handler, scope_config.id_string().c_str(),
675  scope_config.static_broker_addr());
676 
678  etcpal::Error result = rdmnet_device_create(&config.get(), &c_handle);
679 
680  handle_.SetValue(c_handle);
681 
682  return result;
683 }
684 
691 inline void Device::Shutdown(rdmnet_disconnect_reason_t disconnect_reason)
692 {
693  rdmnet_device_destroy(handle_.value(), disconnect_reason);
694  handle_.Clear();
695 }
696 
710 inline etcpal::Error Device::ChangeScope(const char* new_scope_id_str,
711  rdmnet_disconnect_reason_t disconnect_reason,
712  const etcpal::SockAddr& static_broker_addr)
713 {
714  if (!new_scope_id_str)
715  return kEtcPalErrInvalid;
716 
717  RdmnetScopeConfig new_scope_config = {new_scope_id_str, static_broker_addr.get()};
718  return rdmnet_device_change_scope(handle_.value(), &new_scope_config, disconnect_reason);
719 }
720 
732 inline etcpal::Error Device::ChangeScope(const Scope& new_scope_config, rdmnet_disconnect_reason_t disconnect_reason)
733 {
734  RdmnetScopeConfig translated_config = {new_scope_config.id_string().c_str(),
735  new_scope_config.static_broker_addr().get()};
736  return rdmnet_device_change_scope(handle_.value(), &translated_config, disconnect_reason);
737 }
738 
753 inline etcpal::Error Device::ChangeSearchDomain(const char* new_search_domain,
754  rdmnet_disconnect_reason_t disconnect_reason)
755 {
756  if (!new_search_domain)
757  return kEtcPalErrInvalid;
758 
759  return rdmnet_device_change_search_domain(handle_.value(), new_search_domain, disconnect_reason);
760 }
761 
769  const uint8_t* response_data,
770  size_t response_data_len)
771 {
772  return rdmnet_device_send_rdm_ack(handle_.value(), &received_cmd.get(), response_data, response_data_len);
773 }
774 
780 inline etcpal::Error Device::SendRdmNack(const SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason)
781 {
782  return rdmnet_device_send_rdm_nack(handle_.value(), &received_cmd.get(), nack_reason);
783 }
784 
791 inline etcpal::Error Device::SendRdmNack(const SavedRdmCommand& received_cmd, uint16_t raw_nack_reason)
792 {
793  return rdmnet_device_send_rdm_nack(handle_.value(), &received_cmd.get(),
794  static_cast<rdm_nack_reason_t>(raw_nack_reason));
795 }
796 
807 inline etcpal::Error Device::SendRdmUpdate(uint16_t param_id, const uint8_t* data, size_t data_len)
808 {
809  return rdmnet_device_send_rdm_update(handle_.value(), 0, param_id, data, data_len);
810 }
811 
823 inline etcpal::Error Device::SendRdmUpdate(uint16_t subdevice, uint16_t param_id, const uint8_t* data, size_t data_len)
824 {
825  return rdmnet_device_send_rdm_update(handle_.value(), subdevice, param_id, data, data_len);
826 }
827 
842  uint16_t param_id,
843  const uint8_t* data,
844  size_t data_len)
845 {
846  return rdmnet_device_send_rdm_update_from_responder(handle_.value(), &source_addr.get(), param_id, data, data_len);
847 }
848 
861  rpt_status_code_t status_code,
862  const char* status_string)
863 {
864  return rdmnet_device_send_status(handle_.value(), &received_cmd.get(), status_code, status_string);
865 }
866 
874  const uint8_t* response_data,
875  uint8_t response_data_len)
876 {
877  return rdmnet_device_send_llrp_ack(handle_.value(), &received_cmd.get(), response_data, response_data_len);
878 }
879 
885 inline etcpal::Error Device::SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, rdm_nack_reason_t nack_reason)
886 {
887  return rdmnet_device_send_llrp_nack(handle_.value(), &received_cmd.get(), nack_reason);
888 }
889 
896 inline etcpal::Error Device::SendLlrpNack(const llrp::SavedRdmCommand& received_cmd, uint16_t raw_nack_reason)
897 {
898  return rdmnet_device_send_llrp_nack(handle_.value(), &received_cmd.get(),
899  static_cast<rdm_nack_reason_t>(raw_nack_reason));
900 }
901 
911 {
912  return rdmnet_device_add_virtual_endpoint(handle_.value(), &endpoint_config.get());
913 }
914 
924 {
925  if (endpoint_configs.empty())
926  return kEtcPalErrInvalid;
927 
929  virtual_endpts.reserve(endpoint_configs.size());
930  std::transform(endpoint_configs.begin(), endpoint_configs.end(), std::back_inserter(virtual_endpts),
931  [](const VirtualEndpointConfig& config) { return config.get(); });
932 
933  return rdmnet_device_add_virtual_endpoints(handle_.value(), virtual_endpts.data(), virtual_endpts.size());
934 }
935 
945 {
946  return rdmnet_device_add_physical_endpoint(handle_.value(), &endpoint_config.get());
947 }
948 
958 {
959  if (endpoint_configs.empty())
960  return kEtcPalErrInvalid;
961 
963  physical_endpts.reserve(endpoint_configs.size());
964  std::transform(endpoint_configs.begin(), endpoint_configs.end(), std::back_inserter(physical_endpts),
965  [](const PhysicalEndpointConfig& config) { return config.get(); });
966 
967  return rdmnet_device_add_physical_endpoints(handle_.value(), physical_endpts.data(), physical_endpts.size());
968 }
969 
978 inline etcpal::Error Device::RemoveEndpoint(uint16_t endpoint_id)
979 {
980  return rdmnet_device_remove_endpoint(handle_.value(), endpoint_id);
981 }
982 
993 {
994  if (endpoint_ids.empty())
995  return kEtcPalErrInvalid;
996 
997  return rdmnet_device_remove_endpoints(handle_.value(), endpoint_ids.data(), endpoint_ids.size());
998 }
999 
1015 inline etcpal::Error Device::AddVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id)
1016 {
1017  return rdmnet_device_add_dynamic_responders(handle_.value(), endpoint_id, &responder_id.get(), 1);
1018 }
1019 
1032 inline etcpal::Error Device::AddVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid)
1033 {
1034  return rdmnet_device_add_static_responders(handle_.value(), endpoint_id, &responder_static_uid.get(), 1);
1035 }
1036 
1052 inline etcpal::Error Device::AddVirtualResponders(uint16_t endpoint_id, const std::vector<etcpal::Uuid>& responder_ids)
1053 {
1054  if (responder_ids.empty())
1055  return kEtcPalErrInvalid;
1056 
1058  ids.reserve(responder_ids.size());
1059  std::transform(responder_ids.begin(), responder_ids.end(), std::back_inserter(ids),
1060  [](const etcpal::Uuid& id) { return id.get(); });
1061 
1062  return rdmnet_device_add_dynamic_responders(handle_.value(), endpoint_id, ids.data(), ids.size());
1063 }
1064 
1077 inline etcpal::Error Device::AddVirtualResponders(uint16_t endpoint_id,
1078  const std::vector<rdm::Uid>& responder_static_uids)
1079 {
1080  if (responder_static_uids.empty())
1081  return kEtcPalErrInvalid;
1082 
1083  std::vector<RdmUid> uids;
1084  uids.reserve(responder_static_uids.size());
1085  std::transform(responder_static_uids.begin(), responder_static_uids.end(), std::back_inserter(uids),
1086  [](const rdm::Uid& uid) { return uid.get(); });
1087 
1088  return rdmnet_device_add_static_responders(handle_.value(), endpoint_id, uids.data(), uids.size());
1089 }
1090 
1105 inline etcpal::Error Device::AddPhysicalResponder(uint16_t endpoint_id,
1106  const rdm::Uid& responder_uid,
1107  uint16_t control_field,
1108  const rdm::Uid& binding_uid)
1109 {
1110  RdmnetPhysicalEndpointResponder responder = {responder_uid.get(), control_field, binding_uid.get()};
1111  return rdmnet_device_add_physical_responders(handle_.value(), endpoint_id, &responder, 1);
1112 }
1113 
1126 inline etcpal::Error Device::AddPhysicalResponder(uint16_t endpoint_id, const PhysicalEndpointResponder& responder)
1127 {
1128  return rdmnet_device_add_physical_responders(handle_.value(), endpoint_id, &responder.get(), 1);
1129 }
1130 
1143 inline etcpal::Error Device::AddPhysicalResponders(uint16_t endpoint_id,
1144  const std::vector<PhysicalEndpointResponder>& responders)
1145 {
1146  if (responders.empty())
1147  return kEtcPalErrInvalid;
1148 
1150  resps.reserve(responders.size());
1151  std::transform(responders.begin(), responders.end(), std::back_inserter(resps),
1152  [](const PhysicalEndpointResponder& responder) { return responder.get(); });
1153 
1154  return rdmnet_device_add_physical_responders(handle_.value(), endpoint_id, resps.data(), resps.size());
1155 }
1156 
1170 inline etcpal::Error Device::RemoveVirtualResponder(uint16_t endpoint_id, const etcpal::Uuid& responder_id)
1171 {
1172  return rdmnet_device_remove_dynamic_responders(handle_.value(), endpoint_id, &responder_id.get(), 1);
1173 }
1174 
1188 inline etcpal::Error Device::RemoveVirtualResponder(uint16_t endpoint_id, const rdm::Uid& responder_static_uid)
1189 {
1190  return rdmnet_device_remove_static_responders(handle_.value(), endpoint_id, &responder_static_uid.get(), 1);
1191 }
1192 
1207  const std::vector<etcpal::Uuid>& responder_ids)
1208 {
1209  if (responder_ids.empty())
1210  return kEtcPalErrInvalid;
1211 
1213  ids.reserve(responder_ids.size());
1214  std::transform(responder_ids.begin(), responder_ids.end(), std::back_inserter(ids),
1215  [](const etcpal::Uuid& id) { return id.get(); });
1216 
1217  return rdmnet_device_remove_dynamic_responders(handle_.value(), endpoint_id, ids.data(), ids.size());
1218 }
1219 
1234  const std::vector<rdm::Uid>& responder_static_uids)
1235 {
1236  if (responder_static_uids.empty())
1237  return kEtcPalErrInvalid;
1238 
1239  std::vector<RdmUid> uids;
1240  uids.reserve(responder_static_uids.size());
1241  std::transform(responder_static_uids.begin(), responder_static_uids.end(), std::back_inserter(uids),
1242  [](const rdm::Uid& uid) { return uid.get(); });
1243 
1244  return rdmnet_device_remove_static_responders(handle_.value(), endpoint_id, uids.data(), uids.size());
1245 }
1246 
1260 inline etcpal::Error Device::RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid& responder_uid)
1261 {
1262  return rdmnet_device_remove_physical_responders(handle_.value(), endpoint_id, &responder_uid.get(), 1);
1263 }
1264 
1278 inline etcpal::Error Device::RemovePhysicalResponders(uint16_t endpoint_id, const std::vector<rdm::Uid>& responder_uids)
1279 {
1280  if (responder_uids.empty())
1281  return kEtcPalErrInvalid;
1282 
1283  std::vector<RdmUid> uids;
1284  uids.reserve(responder_uids.size());
1285  std::transform(responder_uids.begin(), responder_uids.end(), std::back_inserter(uids),
1286  [](const rdm::Uid& uid) { return uid.get(); });
1287 
1288  return rdmnet_device_remove_physical_responders(handle_.value(), endpoint_id, uids.data(), uids.size());
1289 }
1290 
1293 {
1294  return handle_;
1295 }
1296 
1299 {
1300  return notify_;
1301 }
1302 
1308 {
1309  std::string scope_id(E133_SCOPE_STRING_PADDED_LENGTH, 0);
1310  EtcPalSockAddr static_broker_addr;
1311  etcpal_error_t res = rdmnet_device_get_scope(handle_.value(), &scope_id[0], &static_broker_addr);
1312  if (res == kEtcPalErrOk)
1313  return Scope(scope_id, static_broker_addr);
1314  else
1315  return res;
1316 }
1317 
1318 inline const RdmnetDeviceConfig& Device::TranslatedConfig::get() noexcept
1319 {
1320  if (!physical_endpoints_.empty())
1321  {
1322  config_.physical_endpoints = physical_endpoints_.data();
1323  config_.num_physical_endpoints = physical_endpoints_.size();
1324  }
1325  if (!virtual_endpoints_.empty())
1326  {
1327  config_.virtual_endpoints = virtual_endpoints_.data();
1328  config_.num_virtual_endpoints = virtual_endpoints_.size();
1329  }
1330  return config_;
1331 }
1332 
1333 // clang-format off
1334 inline Device::TranslatedConfig::TranslatedConfig(const Settings& settings,
1335  NotifyHandler& notify_handler,
1336  const char* scope,
1337  const etcpal::SockAddr& static_broker_addr)
1338  : config_{
1339  settings.cid.get(),
1340  {
1341  ::rdmnet::internal::DeviceLibCbConnected,
1342  ::rdmnet::internal::DeviceLibCbConnectFailed,
1343  ::rdmnet::internal::DeviceLibCbDisconnected,
1344  ::rdmnet::internal::DeviceLibCbRdmCommandReceived,
1345  ::rdmnet::internal::DeviceLibCbLlrpRdmCommandReceived,
1346  ::rdmnet::internal::DeviceLibCbDynamicUidStatus,
1348  },
1349  settings.response_buf,
1350  {
1351  scope,
1352  static_broker_addr.get()
1353  },
1354  settings.uid.get(),
1355  settings.search_domain.c_str(),
1356  nullptr,
1357  0,
1358  nullptr,
1359  0
1360  }
1361 {
1362  // clang-format on
1363 
1364  // Physical endpoints
1365  if (!settings.physical_endpoints.empty())
1366  {
1367  physical_endpoints_.reserve(settings.physical_endpoints.size());
1368  std::transform(settings.physical_endpoints.begin(), settings.physical_endpoints.end(),
1369  std::back_inserter(physical_endpoints_),
1370  [](const PhysicalEndpointConfig& config) { return config.get(); });
1371  }
1372 
1373  // Virtual endpoints
1374  if (!settings.virtual_endpoints.empty())
1375  {
1376  virtual_endpoints_.reserve(settings.virtual_endpoints.size());
1377  std::transform(settings.virtual_endpoints.begin(), settings.virtual_endpoints.end(),
1378  std::back_inserter(virtual_endpoints_),
1379  [](const VirtualEndpointConfig& config) { return config.get(); });
1380  }
1381 }
1382 
1383 }; // namespace rdmnet
1384 
1385 #endif // RDMNET_CPP_DEVICE_H_
T back_inserter(T... args)
T begin(T... args)
T c_str(T... args)
ETCPAL_CONSTEXPR_14 void Clear()
ETCPAL_CONSTEXPR_14 void SetValue(const ValueType &new_value)
constexpr ValueType value() const
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:228
Information about a successful connection to a broker delivered to an RDMnet callback function.
Definition: client.h:158
Information about a disconnect event from a broker delivered to an RDMnet callback function.
Definition: client.h:346
A base class for a class that receives notification callbacks from a device.
Definition: device.h:334
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:375
virtual RdmResponseAction HandleRdmCommand(Handle handle, const RdmCommand &cmd)=0
An RDM command has been received addressed to a device.
virtual void HandleDisconnectedFromBroker(Handle handle, const ClientDisconnectedInfo &info)=0
A device which was previously connected to a broker has disconnected.
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 RdmResponseAction HandleLlrpRdmCommand(Handle handle, const llrp::RdmCommand &cmd)=0
An RDM command has been received over LLRP, addressed to a device.
An instance of RDMnet device functionality.
Definition: device.h:324
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:807
etcpal::Error RemoveEndpoints(const std::vector< uint16_t > &endpoint_ids)
Remove multiple endpoints from a device.
Definition: device.h:992
etcpal::Error RemovePhysicalResponder(uint16_t endpoint_id, const rdm::Uid &responder_uid)
Remove a responder from a physical endpoint.
Definition: device.h:1260
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:885
etcpal::Error RemovePhysicalResponders(uint16_t endpoint_id, const std::vector< rdm::Uid > &responder_uids)
Remove multiple responders from a physical endpoint.
Definition: device.h:1278
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:873
constexpr Handle handle() const
Retrieve the handle of a device instance.
Definition: device.h:1292
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:860
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:1170
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:1015
etcpal::Error AddPhysicalEndpoints(const std::vector< PhysicalEndpointConfig > &endpoint_configs)
Add multiple physical endpoints to a device.
Definition: device.h:957
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:1052
etcpal::Error AddPhysicalResponders(uint16_t endpoint_id, const std::vector< PhysicalEndpointResponder > &responders)
Add multiple responders to a physical endpoint.
Definition: device.h:1143
etcpal::Error AddVirtualEndpoints(const std::vector< VirtualEndpointConfig > &endpoint_configs)
Add multiple virtual endpoints to a device.
Definition: device.h:923
etcpal::OpaqueId< detail::DeviceHandleType, rdmnet_device_t, RDMNET_DEVICE_INVALID > Handle
A handle type used by the RDMnet library to identify device instances.
Definition: device.h:327
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:768
etcpal::Error RemoveEndpoint(uint16_t endpoint_id)
Remove an endpoint from a device.
Definition: device.h:978
void Shutdown(rdmnet_disconnect_reason_t disconnect_reason=kRdmnetDisconnectShutdown)
Shut down this device and deallocate resources.
Definition: device.h:691
etcpal::Error AddPhysicalEndpoint(const PhysicalEndpointConfig &physical_config)
Add a physical endpoint to a device.
Definition: device.h:944
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:1206
etcpal::Error AddVirtualEndpoint(const VirtualEndpointConfig &endpoint_config)
Add a virtual endpoint to a device.
Definition: device.h:910
etcpal::Error ChangeSearchDomain(const char *new_search_domain, rdmnet_disconnect_reason_t disconnect_reason)
Change the device's DNS search domain.
Definition: device.h:753
Device(Device &&other)=default
Move a device instance.
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:1105
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:641
constexpr NotifyHandler * notify_handler() const
Retrieve the NotifyHandler reference that this device was configured with.
Definition: device.h:1298
Device & operator=(Device &&other)=default
Move a device instance.
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:710
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:780
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:612
etcpal::Expected< Scope > scope() const
Retrieve the scope configuration associated with a device instance.
Definition: device.h:1307
A list of mappings from dynamic UIDs to responder IDs received from an RDMnet broker.
Definition: dynamic_uid.h:99
Configuration information for a physical endpoint on a device.
Definition: device.h:260
const RdmnetPhysicalEndpointConfig & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:307
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:278
Identifying information for a physical RDM responder connected to an RDMnet gateway.
Definition: device.h:212
ETCPAL_CONSTEXPR_14 const RdmnetPhysicalEndpointResponder & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:236
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:228
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:146
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:469
const etcpal::SockAddr & static_broker_addr() const noexcept
The static broker address associated with this scope.
Definition: client.h:524
const std::string & id_string() const noexcept
The ID string of this scope.
Definition: client.h:515
The source address for an unsolicited RDM response generated by a local component.
Definition: client.h:48
constexpr const RdmnetSourceAddr & get() const noexcept
Get a const reference to the underlying C type.
Definition: client.h:61
Configuration information for a virtual endpoint on a device.
Definition: device.h:79
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:109
const RdmnetVirtualEndpointConfig & get() const noexcept
Get a const reference to the underlying C type.
Definition: device.h:189
Definition: device.h:56
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
Definition: common.h:85
rpt_status_code_t
Definition: common.h:53
@ kRdmnetDisconnectShutdown
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:698
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:776
etcpal_error_t rdmnet_device_destroy(rdmnet_device_t handle, rdmnet_disconnect_reason_t disconnect_reason)
Destroy a device instance.
Definition: device.c:266
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:328
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:1072
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:884
#define RDMNET_DEVICE_INVALID
Definition: device.h:56
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:404
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:1146
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:542
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:367
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:581
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:934
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:659
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:620
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:510
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:1184
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:477
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:830
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:295
int rdmnet_device_t
Definition: device.h:54
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:1220
etcpal_error_t rdmnet_device_create(const RdmnetDeviceConfig *config, rdmnet_device_t *handle)
Create a new instance of RDMnet device functionality.
Definition: device.c:228
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:733
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:1009
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:443
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)
Definition: message.h:440
Definition: client.h:164
Definition: client.h:151
Definition: client.h:196
A set of information that defines the startup parameters of an RDMnet Device.
Definition: device.h:233
const RdmnetPhysicalEndpointConfig * physical_endpoints
Definition: device.h:273
Definition: message.h:246
Configuration information for a physical endpoint on a device.
Definition: device.h:199
size_t num_responders
Definition: device.h:205
const RdmnetPhysicalEndpointResponder * responders
Definition: device.h:203
Definition: device.h:182
Definition: message.h:54
Definition: client.h:224
Definition: common.h:217
Configuration information for a virtual endpoint on a device.
Definition: device.h:146
const EtcPalUuid * dynamic_responders
An array of initial virtual RDM responders on this endpoint, identified by RID.
Definition: device.h:153
const RdmUid * static_responders
Definition: device.h:157
size_t num_static_responders
Definition: device.h:159
size_t num_dynamic_responders
Definition: device.h:155
A set of configuration settings that a device needs to initialize.
Definition: device.h:388
rdm::Uid uid
The device's RDM UID. For a dynamic UID, use rdm::Uid::DynamicUidRequest().
Definition: device.h:390
Settings()=default
Create an empty, invalid data structure by default.
std::vector< PhysicalEndpointConfig > physical_endpoints
Array of configurations for physical endpoints that are present on the device at startup.
Definition: device.h:400
std::string search_domain
The device's search domain for discovering brokers.
Definition: device.h:391
uint8_t * response_buf
Definition: device.h:395
etcpal::Uuid cid
The device's Component Identifier (CID).
Definition: device.h:389
bool IsValid() const
Determine whether a device Settings instance contains valid data for RDMnet operation.
Definition: device.h:593
std::vector< VirtualEndpointConfig > virtual_endpoints
Array of configurations for virtual endpoints that are present on the device at startup.
Definition: device.h:398
T transform(T... args)