diff --git a/include/ola/e133/E133StatusHelper.h b/include/ola/e133/E133StatusHelper.h index 9d82ddc32..62c4f223d 100644 --- a/include/ola/e133/E133StatusHelper.h +++ b/include/ola/e133/E133StatusHelper.h @@ -30,24 +30,20 @@ namespace ola { namespace e133 { -using std::string; -using ola::acn::RPTStatusVector; -using ola::e133::E133StatusCode; -using ola::e133::E133ConnectStatusCode; -using ola::rdm::RDMStatusCode; +bool IntToStatusCode(uint16_t input, ola::e133::E133StatusCode *status_code); +std::string StatusCodeToString(ola::e133::E133StatusCode status_code); -bool IntToStatusCode(uint16_t input, E133StatusCode *status_code); -string StatusCodeToString(E133StatusCode status_code); - -bool IntToConnectStatusCode(uint16_t input, - E133ConnectStatusCode *connect_status_code); -string ConnectStatusCodeToString(E133ConnectStatusCode connect_status_code); +bool IntToConnectStatusCode( + uint16_t input, + ola::e133::E133ConnectStatusCode *connect_status_code); +std::string ConnectStatusCodeToString( + E133ConnectStatusCode connect_status_code); bool IntToRPTStatusCode(uint16_t input, - RPTStatusVector *rpt_status_code); -string RPTStatusCodeToString(RPTStatusVector rpt_status_code); -bool RPTStatusCodeToRDMStatusCode(RPTStatusVector rpt_status_code, - RDMStatusCode *rdm_status_code); + ola::acn::RPTStatusVector *rpt_status_code); +std::string RPTStatusCodeToString(ola::acn::RPTStatusVector rpt_status_code); +bool RPTStatusCodeToRDMStatusCode(ola::acn::RPTStatusVector rpt_status_code, + ola::rdm::RDMStatusCode *rdm_status_code); } // namespace e133 } // namespace ola #endif // INCLUDE_OLA_E133_E133STATUSHELPER_H_ diff --git a/include/ola/rdm/RDMEnums.h b/include/ola/rdm/RDMEnums.h index 72bc8aabe..b4c7230c0 100644 --- a/include/ola/rdm/RDMEnums.h +++ b/include/ola/rdm/RDMEnums.h @@ -159,28 +159,6 @@ typedef enum { PID_PRESET_MERGEMODE = 0x1043, PID_POWER_ON_SELF_TEST = 0x1044, - // Draft E1.33 PIDs - DO NOT USE - PID_ENDPOINT_LIST = 0x7FE0, - PID_ENDPOINT_TO_UNIVERSE = 0x7FE1, - PID_RDM_TRAFFIC_ENABLE = 0x7FE2, - PID_ENDPOINT_MODE = 0x7FE3, - PID_ENDPOINT_LABEL = 0x7FE4, - PID_DISCOVERY_STATE = 0x7FE5, - PID_ENDPOINT_TIMING = 0x7FE6, - PID_ENDPOINT_TIMING_DESCRIPTION = 0x7FE7, - PID_BINDING_CONTROL_FIELDS = 0x7FE8, - PID_ENDPOINT_IDENTIFY = 0x7FE9, - PID_BACKGROUND_DISCOVERY = 0x7FEA, - PID_ENDPOINT_DEVICE_LIST_CHANGE = 0x7FEB, - PID_ENDPOINT_DEVICES = 0x7FEC, - PID_TCP_COMMS_STATUS = 0x7FED, - PID_ENDPOINT_LIST_CHANGE = 0x7FEE, - PID_BACKGROUND_QUEUED_STATUS_POLICY = 0x7FD0, - PID_BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION = 0x7FD1, - PID_BACKGROUND_STATUS_TYPE = 0x7FD2, - PID_QUEUED_STATUS_ENDPOINT_COLLECTION = 0x7FD3, - PID_QUEUED_STATUS_UID_COLLECTION = 0x7FD4, - // E1.37-2 PIDs PID_LIST_INTERFACES = 0x0700, PID_INTERFACE_LABEL = 0x0701, @@ -196,6 +174,30 @@ typedef enum { PID_DNS_NAME_SERVER = 0x070B, PID_DNS_HOSTNAME = 0x070C, PID_DNS_DOMAIN_NAME = 0x070D, + + // E1.33 PIDs + PID_COMPONENT_SCOPE = 0x0800, + PID_SEARCH_DOMAIN = 0x0801, + PID_TCP_COMMS_STATUS = 0x0802, + PID_BROKER_STATUS = 0x0803, + + // E1.37-7 PIDs + PID_ENDPOINT_LIST = 0x0900, + PID_ENDPOINT_LIST_CHANGE = 0x0901, + PID_IDENTIFY_ENDPOINT = 0x0902, + PID_ENDPOINT_TO_UNIVERSE = 0x0903, + PID_ENDPOINT_MODE = 0x0904, + PID_ENDPOINT_LABEL = 0x0905, + PID_RDM_TRAFFIC_ENABLE = 0x0906, + PID_DISCOVERY_STATE = 0x0907, + PID_BACKGROUND_DISCOVERY = 0x908, + PID_ENDPOINT_TIMING = 0x0909, + PID_ENDPOINT_TIMING_DESCRIPTION = 0x090A, + PID_ENDPOINT_RESPONDERS = 0x090B, + PID_ENDPOINT_RESPONDER_LIST_CHANGE = 0x090C, + PID_BINDING_CONTROL_FIELDS = 0x090D, + PID_BACKGROUND_QUEUED_STATUS_POLICY = 0x090E, + PID_BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION = 0x090F, } rdm_pid; diff --git a/include/olad/PluginAdaptor.h b/include/olad/PluginAdaptor.h index 222a56d15..59a33bbc7 100644 --- a/include/olad/PluginAdaptor.h +++ b/include/olad/PluginAdaptor.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,13 +49,15 @@ class PluginAdaptor: public ola::io::SelectServerInterface { * @param preferences_factory pointer to the PreferencesFactory object * @param port_broker pointer to the PortBroker object * @param instance_name the instance name of this OlaServer + * @param uid the default ola::rdm::UID of this OlaServer */ PluginAdaptor(class DeviceManager *device_manager, ola::io::SelectServerInterface *select_server, ExportMap *export_map, class PreferencesFactory *preferences_factory, class PortBrokerInterface *port_broker, - const std::string *instance_name); + const std::string *instance_name, + const ola::rdm::UID *default_uid); // The following methods are part of the SelectServerInterface bool AddReadDescriptor(ola::io::ReadFileDescriptor *descriptor); @@ -98,6 +101,12 @@ class PluginAdaptor: public ola::io::SelectServerInterface { */ const std::string InstanceName() const; + /** + * @brief Return the default UID for the OLA server + * @return an ola::rdm::UID which is the UID for the server + */ + const ola::rdm::UID DefaultUID() const; + ExportMap *GetExportMap() const { return m_export_map; } @@ -134,6 +143,7 @@ class PluginAdaptor: public ola::io::SelectServerInterface { class PreferencesFactory *m_preferences_factory; class PortBrokerInterface *m_port_broker; const std::string *m_instance_name; + const ola::rdm::UID *m_default_uid; DISALLOW_COPY_AND_ASSIGN(PluginAdaptor); }; diff --git a/libs/acn/E133StatusHelper.cpp b/libs/acn/E133StatusHelper.cpp index 9b6279185..534525521 100644 --- a/libs/acn/E133StatusHelper.cpp +++ b/libs/acn/E133StatusHelper.cpp @@ -27,6 +27,10 @@ namespace ola { namespace e133 { using std::string; +using ola::acn::RPTStatusVector; +using ola::e133::E133StatusCode; +using ola::e133::E133ConnectStatusCode; +using ola::rdm::RDMStatusCode; /** * Verify that the int is a valid E1.33 Status Code. diff --git a/libs/acn/LLRPProbeReplyPDU.cpp b/libs/acn/LLRPProbeReplyPDU.cpp index f92ad721b..b0f841902 100644 --- a/libs/acn/LLRPProbeReplyPDU.cpp +++ b/libs/acn/LLRPProbeReplyPDU.cpp @@ -57,6 +57,11 @@ void LLRPProbeReplyPDU::PrependPDU(ola::io::IOStack *stack, const UID &target_uid, const MACAddress &hardware_address, const LLRPComponentType type) { + if (!stack) { + OLA_WARN << "LLRPProbeReplyPDU::PrependPDU: missing stack"; + return; + } + llrp_probe_reply_pdu_data data; target_uid.Pack(data.target_uid, sizeof(data.target_uid)); hardware_address.Pack(data.hardware_address, sizeof(data.hardware_address)); diff --git a/libs/acn/LLRPProbeReplyPDUTest.cpp b/libs/acn/LLRPProbeReplyPDUTest.cpp index 1ce2ca86f..6c2766747 100644 --- a/libs/acn/LLRPProbeReplyPDUTest.cpp +++ b/libs/acn/LLRPProbeReplyPDUTest.cpp @@ -176,6 +176,14 @@ void LLRPProbeReplyPDUTest::testPrepend() { 0xff }; OLA_ASSERT_DATA_EQUALS(expected_data, sizeof(expected_data), buffer, length); + + // test null stack + LLRPProbeReplyPDU::PrependPDU( + NULL, + target_uid, + hardware_address, + LLRPProbeReplyPDU::LLRP_COMPONENT_TYPE_NON_RDMNET); + delete[] buffer; } } // namespace acn diff --git a/libs/acn/LLRPProbeRequestInflator.cpp b/libs/acn/LLRPProbeRequestInflator.cpp index 3090917e9..d160fa10f 100644 --- a/libs/acn/LLRPProbeRequestInflator.cpp +++ b/libs/acn/LLRPProbeRequestInflator.cpp @@ -103,13 +103,18 @@ bool LLRPProbeRequestInflator::HandlePDUData(uint32_t vector, OLA_DEBUG << "Probe from " << UID(pdu_data.lower_uid) << " to " << UID(pdu_data.upper_uid); + LLRPProbeRequest request(UID(pdu_data.lower_uid), UID(pdu_data.upper_uid)); + request.client_tcp_connection_inactive = + (pdu_data.filter & + LLRPProbeRequestPDU::FILTER_CLIENT_TCP_CONNECTION_INACTIVE); + request.brokers_only = (pdu_data.filter & + LLRPProbeRequestPDU::FILTER_BROKERS_ONLY); + unsigned int known_uids_used_size = known_uids_size; + request.known_uids = UIDSet(pdu_data.known_uids, &known_uids_used_size); + if (m_llrp_probe_request_handler.get()) { m_llrp_probe_request_handler->Run(&headers, - UID(pdu_data.lower_uid), - UID(pdu_data.upper_uid) -// TODO(Peter): Should we add the filter and known UIDs to the callback too? -//, UIDSet() -); + request); } else { OLA_WARN << "No LLRP Probe Request handler defined!"; } diff --git a/libs/acn/LLRPProbeRequestInflator.h b/libs/acn/LLRPProbeRequestInflator.h index 009ae01c8..7cb4b4930 100644 --- a/libs/acn/LLRPProbeRequestInflator.h +++ b/libs/acn/LLRPProbeRequestInflator.h @@ -34,13 +34,23 @@ class LLRPProbeRequestInflator: public BaseInflator { friend class LLRPProbeRequestInflatorTest; public: + struct LLRPProbeRequest { + LLRPProbeRequest(const ola::rdm::UID &_lower, const ola::rdm::UID &_upper) + : lower(_lower), + upper(_upper) { + } + ola::rdm::UID lower; + ola::rdm::UID upper; + bool client_tcp_connection_inactive; + bool brokers_only; + ola::rdm::UIDSet known_uids; + }; + + // These are pointers so the callers don't have to pull in all the headers. - typedef ola::Callback3 LLRPProbeRequestHandler; LLRPProbeRequestInflator(); diff --git a/libs/acn/LLRPProbeRequestPDU.cpp b/libs/acn/LLRPProbeRequestPDU.cpp index 2d3dfcf19..341bf11f6 100644 --- a/libs/acn/LLRPProbeRequestPDU.cpp +++ b/libs/acn/LLRPProbeRequestPDU.cpp @@ -87,6 +87,11 @@ void LLRPProbeRequestPDU::PrependPDU(ola::io::IOStack *stack, bool client_tcp_connection_inactive, bool brokers_only, const ola::rdm::UIDSet &known_uids) { + if (!stack) { + OLA_WARN << "LLRPProbeRequestPDU::PrependPDU: missing stack"; + return; + } + llrp_probe_request_pdu_data data; lower_uid.Pack(data.lower_uid, sizeof(data.lower_uid)); upper_uid.Pack(data.upper_uid, sizeof(data.upper_uid)); diff --git a/libs/acn/LLRPProbeRequestPDUTest.cpp b/libs/acn/LLRPProbeRequestPDUTest.cpp index 88f39d587..23e4e61a3 100644 --- a/libs/acn/LLRPProbeRequestPDUTest.cpp +++ b/libs/acn/LLRPProbeRequestPDUTest.cpp @@ -191,6 +191,15 @@ void LLRPProbeRequestPDUTest::testPrepend() { 0x56, 0x78, 0, 0, 0, 2, }; OLA_ASSERT_DATA_EQUALS(expected_data, sizeof(expected_data), buffer, length); + + // test null stack + LLRPProbeRequestPDU::PrependPDU(NULL, + UID(0x0000, 0x00000000), + UID(0xffff, 0xffffffff), + false, + false, + known_uids); + delete[] buffer; } } // namespace acn diff --git a/olad/OlaServer.cpp b/olad/OlaServer.cpp index 2921a6f99..1050a0bc6 100644 --- a/olad/OlaServer.cpp +++ b/olad/OlaServer.cpp @@ -225,7 +225,7 @@ bool OlaServer::Init() { auto_ptr plugin_adaptor( new PluginAdaptor(device_manager.get(), m_ss, m_export_map, m_preferences_factory, port_broker.get(), - &m_instance_name)); + &m_instance_name, &m_default_uid)); auto_ptr plugin_manager( new PluginManager(m_plugin_loaders, plugin_adaptor.get())); diff --git a/olad/PluginManagerTest.cpp b/olad/PluginManagerTest.cpp index a769f6692..204554755 100644 --- a/olad/PluginManagerTest.cpp +++ b/olad/PluginManagerTest.cpp @@ -103,7 +103,7 @@ class MockLoader: public ola::PluginLoader { */ void PluginManagerTest::testPluginManager() { ola::MemoryPreferencesFactory factory; - ola::PluginAdaptor adaptor(NULL, NULL, NULL, &factory, NULL, NULL); + ola::PluginAdaptor adaptor(NULL, NULL, NULL, &factory, NULL, NULL, NULL); TestMockPlugin plugin1(&adaptor, ola::OLA_PLUGIN_ARTNET); TestMockPlugin plugin2(&adaptor, ola::OLA_PLUGIN_ESPNET, false); @@ -133,7 +133,7 @@ void PluginManagerTest::testPluginManager() { */ void PluginManagerTest::testConflictingPlugins() { ola::MemoryPreferencesFactory factory; - ola::PluginAdaptor adaptor(NULL, NULL, NULL, &factory, NULL, NULL); + ola::PluginAdaptor adaptor(NULL, NULL, NULL, &factory, NULL, NULL, NULL); set conflict_set1, conflict_set2, conflict_set3; conflict_set1.insert(ola::OLA_PLUGIN_ARTNET); diff --git a/olad/plugin_api/PluginAdaptor.cpp b/olad/plugin_api/PluginAdaptor.cpp index da50565cf..706105059 100644 --- a/olad/plugin_api/PluginAdaptor.cpp +++ b/olad/plugin_api/PluginAdaptor.cpp @@ -37,13 +37,15 @@ PluginAdaptor::PluginAdaptor(DeviceManager *device_manager, ExportMap *export_map, PreferencesFactory *preferences_factory, PortBrokerInterface *port_broker, - const std::string *instance_name): + const std::string *instance_name, + const ola::rdm::UID *default_uid): m_device_manager(device_manager), m_ss(select_server), m_export_map(export_map), m_preferences_factory(preferences_factory), m_port_broker(port_broker), - m_instance_name(instance_name) { + m_instance_name(instance_name), + m_default_uid(default_uid) { } bool PluginAdaptor::AddReadDescriptor( @@ -136,4 +138,12 @@ const std::string PluginAdaptor::InstanceName() const { return ""; } } + +const ola::rdm::UID PluginAdaptor::DefaultUID() const { + if (m_default_uid) { + return *m_default_uid; + } else { + return ola::rdm::UID(0, 0); + } +} } // namespace ola diff --git a/olad/plugin_api/PortTest.cpp b/olad/plugin_api/PortTest.cpp index f7379507c..42849d71d 100644 --- a/olad/plugin_api/PortTest.cpp +++ b/olad/plugin_api/PortTest.cpp @@ -91,7 +91,7 @@ void PortTest::testInputPortPriorities() { MockDevice device(NULL, "foo"); TimeStamp time_stamp; MockSelectServer ss(&time_stamp); - ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL); + ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL, NULL); // This port operates in static priority mode TestMockInputPort input_port(&device, 1, &plugin_adaptor); port_manager.PatchPort(&input_port, universe_id); diff --git a/olad/plugin_api/UniverseTest.cpp b/olad/plugin_api/UniverseTest.cpp index 7b5d2d5b5..69f0904fd 100644 --- a/olad/plugin_api/UniverseTest.cpp +++ b/olad/plugin_api/UniverseTest.cpp @@ -241,7 +241,7 @@ void UniverseTest::testReceiveDmx() { ola::PortManager port_manager(m_store, &broker); TimeStamp time_stamp; MockSelectServer ss(&time_stamp); - ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL); + ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL, NULL); MockDevice device(NULL, "foo"); TestMockInputPort port(&device, 1, &plugin_adaptor); // input port @@ -366,7 +366,7 @@ void UniverseTest::testLtpMerging() { TimeStamp time_stamp; MockSelectServer ss(&time_stamp); - ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL); + ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL, NULL); MockDevice device(NULL, "foo"); MockDevice device2(NULL, "bar"); TestMockInputPort port(&device, 1, &plugin_adaptor); // input port @@ -446,7 +446,7 @@ void UniverseTest::testHtpMerging() { TimeStamp time_stamp; MockSelectServer ss(&time_stamp); - ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL); + ola::PluginAdaptor plugin_adaptor(NULL, &ss, NULL, NULL, NULL, NULL, NULL); MockDevice device(NULL, "foo"); MockDevice device2(NULL, "bar"); TestMockInputPort port(&device, 1, &plugin_adaptor); // input port diff --git a/plugins/spi/SPIOutput.h b/plugins/spi/SPIOutput.h index 745e6c7c0..ed37e9b3e 100644 --- a/plugins/spi/SPIOutput.h +++ b/plugins/spi/SPIOutput.h @@ -94,7 +94,7 @@ class SPIOutput: public ola::rdm::DiscoverableRDMControllerInterface { private: /** - * The RDM Operations for the MovingLightResponder. + * The RDM Operations for the SPIOutput. */ class RDMOps : public ola::rdm::ResponderOps { public: diff --git a/python/ola/PidStore.py b/python/ola/PidStore.py index f48db9656..5742b35e9 100644 --- a/python/ola/PidStore.py +++ b/python/ola/PidStore.py @@ -1067,7 +1067,7 @@ def LoadFile(self, pid_file_name, validate, override=False): if validate: if ((pid_pb.value >= RDMConstants.RDM_MANUFACTURER_PID_MIN) and (pid_pb.value <= RDMConstants.RDM_MANUFACTURER_PID_MAX)): - raise InvalidPidFormat('%0x04hx between %0x04hx and %0x04hx in %s' % + raise InvalidPidFormat('0x%04hx between 0x%04hx and 0x%04hx in %s' % (pid_pb.value, RDMConstants.RDM_MANUFACTURER_PID_MIN, RDMConstants.RDM_MANUFACTURER_PID_MAX, @@ -1103,7 +1103,7 @@ def LoadFile(self, pid_file_name, validate, override=False): if ((pid_pb.value < RDMConstants.RDM_MANUFACTURER_PID_MIN) or (pid_pb.value > RDMConstants.RDM_MANUFACTURER_PID_MAX)): raise InvalidPidFormat( - 'Manufacturer pid 0x%04hx not between %0x04hx and %0x04hx' % + 'Manufacturer pid 0x%04hx not between 0x%04hx and 0x%04hx' % (pid_pb.value, RDMConstants.RDM_MANUFACTURER_PID_MIN, RDMConstants.RDM_MANUFACTURER_PID_MAX)) diff --git a/tools/e133/E133Endpoint.cpp b/tools/e133/E133Endpoint.cpp index f0fbd4492..58efa583f 100644 --- a/tools/e133/E133Endpoint.cpp +++ b/tools/e133/E133Endpoint.cpp @@ -44,7 +44,7 @@ E133Endpoint::E133Endpoint(DiscoverableRDMControllerInterface *controller, m_is_physical(properties.is_physical), m_universe(UNPATCHED_UNIVERSE), m_endpoint_label(""), - m_device_list_change(0), + m_responder_list_change(0), m_controller(controller) { } diff --git a/tools/e133/E133Endpoint.h b/tools/e133/E133Endpoint.h index d57a6830f..7b8b58c16 100644 --- a/tools/e133/E133Endpoint.h +++ b/tools/e133/E133Endpoint.h @@ -81,11 +81,11 @@ class E133EndpointInterface // ENDPOINT_TIMING_DESCRIPTION - // ENDPOINT_DEVICE_LIST_CHANGE - virtual uint32_t device_list_change() const = 0; + // ENDPOINT_RESPONDER_LIST_CHANGE + virtual uint32_t responder_list_change() const = 0; - // ENDPOINT_DEVICES - virtual void EndpointDevices(UIDSet *uids) const = 0; + // ENDPOINT_RESPONDERS + virtual void EndpointResponders(UIDSet *uids) const = 0; // BINDING_AND_CONTROL_FIELDS @@ -141,8 +141,8 @@ class E133Endpoint: public E133EndpointInterface { m_endpoint_label = endpoint_label; } - uint32_t device_list_change() const { return m_device_list_change; } - void EndpointDevices(UIDSet *uids) const { *uids = m_uids; } + uint32_t responder_list_change() const { return m_responder_list_change; } + void EndpointResponders(UIDSet *uids) const { *uids = m_uids; } virtual void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback); virtual void RunIncrementalDiscovery( @@ -156,7 +156,7 @@ class E133Endpoint: public E133EndpointInterface { const bool m_is_physical; uint16_t m_universe; string m_endpoint_label; - uint32_t m_device_list_change; + uint32_t m_responder_list_change; UIDSet m_uids; DiscoverableRDMControllerInterface *m_controller; }; diff --git a/tools/e133/ManagementEndpoint.cpp b/tools/e133/ManagementEndpoint.cpp index af67274a5..4c1ca18ed 100644 --- a/tools/e133/ManagementEndpoint.cpp +++ b/tools/e133/ManagementEndpoint.cpp @@ -59,9 +59,9 @@ const ola::rdm::ResponderOps::ParamHandler { ola::rdm::PID_ENDPOINT_LIST_CHANGE, &ManagementEndpoint::GetEndpointListChange, NULL}, - { ola::rdm::PID_ENDPOINT_IDENTIFY, - &ManagementEndpoint::GetEndpointIdentify, - &ManagementEndpoint::SetEndpointIdentify}, + { ola::rdm::PID_IDENTIFY_ENDPOINT, + &ManagementEndpoint::GetIdentifyEndpoint, + &ManagementEndpoint::SetIdentifyEndpoint}, { ola::rdm::PID_ENDPOINT_TO_UNIVERSE, &ManagementEndpoint::GetEndpointToUniverse, &ManagementEndpoint::SetEndpointToUniverse}, @@ -76,11 +76,11 @@ const ola::rdm::ResponderOps::ParamHandler // PID_BACKGROUND_DISCOVERY // PID_ENDPOINT_TIMING // PID_ENDPOINT_TIMING_DESCRIPTION - { ola::rdm::PID_ENDPOINT_LIST_CHANGE, - &ManagementEndpoint::GetEndpointDeviceListChange, + { ola::rdm::PID_ENDPOINT_RESPONDER_LIST_CHANGE, + &ManagementEndpoint::GetEndpointResponderListChange, NULL}, - { ola::rdm::PID_ENDPOINT_DEVICES, - &ManagementEndpoint::GetEndpointDevices, + { ola::rdm::PID_ENDPOINT_RESPONDERS, + &ManagementEndpoint::GetEndpointResponders, NULL}, // PID_BINDING_AND_CONTROL_FIELDS { ola::rdm::PID_TCP_COMMS_STATUS, @@ -222,9 +222,9 @@ RDMResponse *ManagementEndpoint::GetEndpointListChange( /** - * Handle PID_ENDPOINT_IDENTIFY + * Handle PID_IDENTIFY_ENDPOINT */ -RDMResponse *ManagementEndpoint::GetEndpointIdentify( +RDMResponse *ManagementEndpoint::GetIdentifyEndpoint( const RDMRequest *request) { uint16_t endpoint_id; if (!ResponderHelper::ExtractUInt16(request, &endpoint_id)) { @@ -243,41 +243,41 @@ RDMResponse *ManagementEndpoint::GetEndpointIdentify( uint16_t endpoint_number; uint8_t identify_mode; }); - IdentifyEndpointParamData endpoint_identify_message = { + IdentifyEndpointParamData identify_endpoint_message = { HostToNetwork(endpoint_id), endpoint->identify_mode() }; return GetResponseFromData( request, - reinterpret_cast(&endpoint_identify_message), - sizeof(endpoint_identify_message)); + reinterpret_cast(&identify_endpoint_message), + sizeof(identify_endpoint_message)); } -RDMResponse *ManagementEndpoint::SetEndpointIdentify( +RDMResponse *ManagementEndpoint::SetIdentifyEndpoint( const RDMRequest *request) { PACK( struct IdentifyEndpointParamData { uint16_t endpoint_number; uint8_t identify_mode; }); - IdentifyEndpointParamData endpoint_identify_message; + IdentifyEndpointParamData identify_endpoint_message; - if (request->ParamDataSize() != sizeof(endpoint_identify_message)) { + if (request->ParamDataSize() != sizeof(identify_endpoint_message)) { return NackWithReason(request, NR_FORMAT_ERROR); } - memcpy(reinterpret_cast(&endpoint_identify_message), + memcpy(reinterpret_cast(&identify_endpoint_message), request->ParamData(), - sizeof(endpoint_identify_message)); + sizeof(identify_endpoint_message)); E133Endpoint *endpoint = m_endpoint_manager->GetEndpoint( - ola::network::NetworkToHost(endpoint_identify_message.endpoint_number)); + ola::network::NetworkToHost(identify_endpoint_message.endpoint_number)); // endpoint not found if (!endpoint) { return NackWithReason(request, ola::rdm::NR_ENDPOINT_NUMBER_INVALID); } - endpoint->set_identify_mode(endpoint_identify_message.identify_mode); + endpoint->set_identify_mode(identify_endpoint_message.identify_mode); return GetResponseFromData(request, NULL, 0); } @@ -324,9 +324,9 @@ RDMResponse *ManagementEndpoint::SetEndpointLabel(const RDMRequest *request) { } /** - * Handle PID_ENDPOINT_DEVICE_LIST_CHANGE + * Handle PID_ENDPOINT_RESPONDER_LIST_CHANGE */ -RDMResponse *ManagementEndpoint::GetEndpointDeviceListChange( +RDMResponse *ManagementEndpoint::GetEndpointResponderListChange( const RDMRequest *request) { uint16_t endpoint_id; if (!ResponderHelper::ExtractUInt16(request, &endpoint_id)) { @@ -340,7 +340,7 @@ RDMResponse *ManagementEndpoint::GetEndpointDeviceListChange( return NackWithReason(request, ola::rdm::NR_ENDPOINT_NUMBER_INVALID); } - uint32_t list_change_id = HostToNetwork(endpoint->device_list_change()); + uint32_t list_change_id = HostToNetwork(endpoint->responder_list_change()); return GetResponseFromData( request, reinterpret_cast(&list_change_id), @@ -348,9 +348,10 @@ RDMResponse *ManagementEndpoint::GetEndpointDeviceListChange( } /** - * Handle PID_ENDPOINT_DEVICES + * Handle PID_ENDPOINT_RESPONDERS */ -RDMResponse *ManagementEndpoint::GetEndpointDevices(const RDMRequest *request) { +RDMResponse *ManagementEndpoint::GetEndpointResponders( + const RDMRequest *request) { uint16_t endpoint_id; if (!ResponderHelper::ExtractUInt16(request, &endpoint_id)) { return NackWithReason(request, NR_FORMAT_ERROR); @@ -369,21 +370,21 @@ RDMResponse *ManagementEndpoint::GetEndpointDevices(const RDMRequest *request) { } UIDSet uids; - uint32_t list_change_id = HostToNetwork(endpoint->device_list_change()); - endpoint->EndpointDevices(&uids); + uint32_t list_change_id = HostToNetwork(endpoint->responder_list_change()); + endpoint->EndpointResponders(&uids); - struct DeviceListParamData { + struct ResponderListParamData { uint16_t endpoint; uint32_t list_change; uint8_t data[0]; }; // TODO(simon): fix this - we can overflow an RDM packet if there are too - // many devices! + // many responders! unsigned int param_data_size = 2 + 4 + uids.Size() * UID::UID_SIZE; uint8_t *raw_data = new uint8_t[param_data_size]; - DeviceListParamData *param_data = reinterpret_cast( - raw_data); + ResponderListParamData *param_data = + reinterpret_cast(raw_data); // TODO(simon): fix this to track changes. param_data->endpoint = HostToNetwork(endpoint_id); diff --git a/tools/e133/ManagementEndpoint.h b/tools/e133/ManagementEndpoint.h index d54b508eb..79ccc80cf 100644 --- a/tools/e133/ManagementEndpoint.h +++ b/tools/e133/ManagementEndpoint.h @@ -30,7 +30,7 @@ using ola::rdm::RDMResponse; using ola::rdm::RDMCallback; /** - * The ManagementEndpoint handles RDMCommands directed at this E1.33 device. It + * The ManagementEndpoint handles RDMCommands directed at this E1.33 Component. It * can also pass through commands to another controller if there is one * supplied. */ @@ -50,7 +50,7 @@ class ManagementEndpoint: public E133Endpoint { private: /** - * The RDM Operations for the MovingLightResponder. + * The RDM Operations for the ManagementEndpoint. */ class RDMOps : public ola::rdm::ResponderOps { public: @@ -74,16 +74,16 @@ class ManagementEndpoint: public E133Endpoint { // RDM PID handlers. RDMResponse *GetEndpointList(const RDMRequest *request); RDMResponse *GetEndpointListChange(const RDMRequest *request); - RDMResponse *GetEndpointIdentify(const RDMRequest *request); - RDMResponse *SetEndpointIdentify(const RDMRequest *request); + RDMResponse *GetIdentifyEndpoint(const RDMRequest *request); + RDMResponse *SetIdentifyEndpoint(const RDMRequest *request); RDMResponse *GetEndpointToUniverse(const RDMRequest *request); RDMResponse *SetEndpointToUniverse(const RDMRequest *request); RDMResponse *GetEndpointMode(const RDMRequest *request); RDMResponse *SetEndpointMode(const RDMRequest *request); RDMResponse *GetEndpointLabel(const RDMRequest *request); RDMResponse *SetEndpointLabel(const RDMRequest *request); - RDMResponse *GetEndpointDeviceListChange(const RDMRequest *request); - RDMResponse *GetEndpointDevices(const RDMRequest *request); + RDMResponse *GetEndpointResponderListChange(const RDMRequest *request); + RDMResponse *GetEndpointResponders(const RDMRequest *request); RDMResponse *GetTCPCommsStatus(const RDMRequest *request); RDMResponse *SetTCPCommsStatus(const RDMRequest *request);