From 7bbcd3589c9fd73bf665e1476598bcfb6cf7e2bf Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 07:48:48 +0100 Subject: [PATCH 01/45] Standardise another test name --- tools/rdm/TestDefinitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 7ec0dad93f..3b73d7c40b 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -4596,7 +4596,7 @@ def CheckForContiguousSubDevices(self): return True -class CheckBlockAddressConsistency(OptionalParameterTestFixture): +class CheckDMXBlockAddressConsistency(OptionalParameterTestFixture): """Check that the device has subdevices if DMX_BLOCK_ADDRESS is supported.""" CATEGORY = TestCategory.CONTROL REQUIRES = ['sub_device_count'] From 027e6933d2f972f7ef052e7cbbf388f721bc8341 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 18:05:35 +0100 Subject: [PATCH 02/45] Fix some more RDM tests --- tools/rdm/ResponderTest.py | 2 +- tools/rdm/TestDefinitions.py | 136 +++++++++++++++++++++++++++++++++++ tools/rdm/TestMixins.py | 7 +- 3 files changed, 143 insertions(+), 2 deletions(-) diff --git a/tools/rdm/ResponderTest.py b/tools/rdm/ResponderTest.py index 9f8c654fd5..30803cfbe3 100644 --- a/tools/rdm/ResponderTest.py +++ b/tools/rdm/ResponderTest.py @@ -615,7 +615,7 @@ def _CheckForAckOrNack(self, response, unpacked_data, unpack_exception): return False if response.response_code != OlaClient.RDM_COMPLETED_OK: - self.LogDebug(' Request status: %s' % response.ResponseCodeAsString()) + self.LogDebug(' Response status: %s' % response.ResponseCodeAsString()) if response.response_code == OlaClient.RDM_DUB_RESPONSE: # track timing for DUB responses. self._RecordFrameTiming(response, TimingStats.DUB) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 3b73d7c40b..7ae6a68952 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -5826,6 +5826,19 @@ def MinLevelIncreasing(self): return self.upper + 1 +class SetMinimumLevelWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set MINIMUM_LEVEL command with no data.""" + PID = 'MINIMUM_LEVEL' + + +class SetMinimumLevelWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET MINIMUM_LEVEL command with extra data.""" + PID = 'MINIMUM_LEVEL' + DATA = 'foobar' + + # MAXIMUM_LEVEL # ----------------------------------------------------------------------------- class GetMaximumLevel(TestMixins.GetMixin, OptionalParameterTestFixture): @@ -5966,6 +5979,18 @@ def Test(self): self.SendSet(ROOT_DEVICE, self.pid, [self.value]) +class SetMaximumLevelWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set MAXIMUM_LEVEL command with no data.""" + PID = 'MAXIMUM_LEVEL' + + +class SetMaximumLevelWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET MAXIMUM_LEVEL command with extra data.""" + PID = 'MAXIMUM_LEVEL' + + class AllSubDevicesGetMaximumLevel(TestMixins.AllSubDevicesGetMixin, OptionalParameterTestFixture): """Get MAXIMUM_LEVEL addressed to ALL_SUB_DEVICES.""" @@ -7155,6 +7180,54 @@ class AllSubDevicesGetDNSDomainName(TestMixins.AllSubDevicesGetMixin, PID = 'DNS_DOMAIN_NAME' +# DNS_IPV4_NAME_SERVER +# ----------------------------------------------------------------------------- +class AllSubDevicesGetDNSIPv4NameServer(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get DNS_IPV4_NAME_SERVER to ALL_SUB_DEVICES.""" + PID = 'DNS_IPV4_NAME_SERVER' + DATA = [0] + + +# class GetDNSIPv4NameServer(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION +# PID = 'DNS_IPV4_NAME_SERVER' +# TODO(peter): Test get + + +class GetDNSIPv4NameServerWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET DNS_IPV4_NAME_SERVER with no argument given.""" + PID = 'DNS_IPV4_NAME_SERVER' + + +class GetDNSIPv4NameServerWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET DNS_IPV4_NAME_SERVER with more than 1 byte of data.""" + PID = 'DNS_IPV4_NAME_SERVER' + + +# class SetDNSIPv4NameServer(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION +# PID = 'DNS_IPV4_NAME_SERVER' +# TODO(peter): Test set + + +class SetDNSIPv4NameServerWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set DNS_IPV4_NAME_SERVER command with no data.""" + PID = 'DNS_IPV4_NAME_SERVER' + + +class SetDNSIPv4NameServerWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET DNS_IPV4_NAME_SERVER command with extra data.""" + PID = 'DNS_IPV4_NAME_SERVER' + DATA = 'foobar' + + # IPV4_DEFAULT_ROUTE # ----------------------------------------------------------------------------- class GetIPv4DefaultRoute(TestMixins.GetMixin, @@ -7191,6 +7264,69 @@ class AllSubDevicesGetIPv4DefaultRoute(TestMixins.AllSubDevicesGetMixin, PID = 'IPV4_DEFAULT_ROUTE' +# IPV4_DHCP_MODE +# ----------------------------------------------------------------------------- +class AllSubDevicesGetIPv4DHCPMode(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get IPV4_DHCP_MODE to ALL_SUB_DEVICES.""" + PID = 'IPV4_DHCP_MODE' + DATA = [1] + + +# class GetIPv4DHCPMode(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_DHCP_MODE' +# TODO(peter): Test get + + +class GetZeroIPv4DHCPMode(TestMixins.GetZeroUInt32Mixin, + OptionalParameterTestFixture): + """GET IPV4_DHCP_MODE for interface identifier 0.""" + PID = 'IPV4_DHCP_MODE' + + +class GetIPv4DHCPModeWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET IPV4_DHCP_MODE with no argument given.""" + PID = 'IPV4_DHCP_MODE' + + +class GetIPv4DHCPModeWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET IPV4_DHCP_MODE with more than 4 bytes of data.""" + PID = 'IPV4_DHCP_MODE' + DATA = 'foobar' + + +# class SetIPv4DHCPMode(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_DHCP_MODE' +# TODO(peter): Test set + + +# class SetZeroIPv4DHCPMode(TestMixins., +# OptionalParameterTestFixture): +# """SET IPV4_DHCP_MODE to interface identifier 0.""" +# CATEGORY = TestCategory.ERROR_CONDITIONS +# PID = 'IPV4_DHCP_MODE' +# TODO(peter): Test set zero + + +class SetIPv4DHCPModeWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set IPV4_DHCP_MODE command with no data.""" + PID = 'IPV4_DHCP_MODE' + + +class SetIPv4DHCPModeWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET IPV4_DHCP_MODE command with extra data.""" + PID = 'IPV4_DHCP_MODE' + DATA = 'foobar' + + # Interface label # ----------------------------------------------------------------------------- class GetInterfaceLabels(TestMixins.GetSettingDescriptionsListMixin, diff --git a/tools/rdm/TestMixins.py b/tools/rdm/TestMixins.py index 7645019ace..bac10f3733 100644 --- a/tools/rdm/TestMixins.py +++ b/tools/rdm/TestMixins.py @@ -317,6 +317,7 @@ class SetWithDataMixin(ResponderTestFixture): def Test(self): results = [ self.NackSetResult(RDMNack.NR_FORMAT_ERROR), + self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), # Fix this, ideally we change behaviour based on past support of the PID self.AckSetResult( warning='Set %s with data returned an ack' % self.pid.name) ] @@ -333,7 +334,11 @@ class SetWithNoDataMixin(ResponderTestFixture): CATEGORY = TestCategory.ERROR_CONDITIONS def Test(self): - self.AddIfSetSupported(self.NackSetResult(RDMNack.NR_FORMAT_ERROR)) + results = [ + self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), # Fix this, ideally we change behaviour based on past support of the PID + self.NackSetResult(RDMNack.NR_FORMAT_ERROR) + ] + self.AddIfSetSupported(results) self.SendRawSet(PidStore.ROOT_DEVICE, self.pid, '') # TODO(simon): add a method to check this didn't change the value From 27c1d3fb8a83d582efc2969dae15c56eae19e240 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 18:12:19 +0100 Subject: [PATCH 03/45] Always print the frames, even if we got an error --- examples/ola-rdm.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/ola-rdm.cpp b/examples/ola-rdm.cpp index 5511b520ec..b14955ebcd 100644 --- a/examples/ola-rdm.cpp +++ b/examples/ola-rdm.cpp @@ -244,6 +244,8 @@ class RDMController { const ola::client::RDMMetadata &metadata, const ola::rdm::RDMResponse *response); + void ShowFrames(const ola::client::RDMMetadata &metadata); + private: struct PendingRequest { public: @@ -299,16 +301,19 @@ void RDMController::HandleResponse(const ola::client::Result &result, const ola::rdm::RDMResponse *response) { if (!result.Success()) { cerr << "Error: " << result.Error() << endl; + ShowFrames(metadata); m_ola_client.GetSelectServer()->Terminate(); return; } if (metadata.response_code == ola::rdm::RDM_WAS_BROADCAST) { m_ola_client.GetSelectServer()->Terminate(); + // Broadcast, there shouldn't be any frames return; } else if (metadata.response_code != ola::rdm::RDM_COMPLETED_OK) { cerr << "Error: " << ola::rdm::StatusCodeToString(metadata.response_code) << endl; + ShowFrames(metadata); m_ola_client.GetSelectServer()->Terminate(); return; } @@ -317,6 +322,7 @@ void RDMController::HandleResponse(const ola::client::Result &result, cerr << "Error: Missing RDM Response but response_code was " "RDM_COMPLETED_OK, this is a bug, please report it!" << endl; + ShowFrames(metadata); return; } @@ -371,6 +377,15 @@ void RDMController::HandleResponse(const ola::client::Result &result, } PrintRemainingMessages(response->MessageCount()); + ShowFrames(metadata); + m_ola_client.GetSelectServer()->Terminate(); +} + + +/** + * Show frames if asked for + */ +void RDMController::ShowFrames(const ola::client::RDMMetadata &metadata) { if (m_show_frames && !metadata.frames.empty()) { cout << "------- Frame Information --------" << endl; ola::rdm::RDMFrames::const_iterator iter = metadata.frames.begin(); @@ -398,7 +413,6 @@ void RDMController::HandleResponse(const ola::client::Result &result, ola::strings::FormatData(&cout, iter->data.data(), iter->data.size()); } } - m_ola_client.GetSelectServer()->Terminate(); } From 8f88bcd6e76d422625e86d9d55dc15394881e809 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 21:58:31 +0100 Subject: [PATCH 04/45] Be more explicit on why we might have failed for Goddard units --- plugins/usbpro/UsbProWidgetDetector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/usbpro/UsbProWidgetDetector.cpp b/plugins/usbpro/UsbProWidgetDetector.cpp index 0e3c0777cc..c1f55c60e4 100644 --- a/plugins/usbpro/UsbProWidgetDetector.cpp +++ b/plugins/usbpro/UsbProWidgetDetector.cpp @@ -320,9 +320,10 @@ void UsbProWidgetDetector::DiscoveryTimeout(DispatchingUsbProWidget *widget) { CompleteWidgetDiscovery(widget); break; default: - OLA_WARN << "Usb Widget didn't respond to messages, esta id " + OLA_WARN << "USB Widget didn't respond to messages, esta id " << iter->second.information.esta_id << ", device id " << iter->second.information.device_id; + OLA_WARN << "Is device in USB Controller mode if it's a Goddard?"; ola::io::ConnectedDescriptor *descriptor = widget->GetDescriptor(); descriptor->SetOnClose(NULL); From 99ed4cd63df50b22d4340e1f3365ba541c9573c1 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 21:59:45 +0100 Subject: [PATCH 05/45] Be more verbose with the logging --- libs/usb/JaRulePortHandleImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/usb/JaRulePortHandleImpl.cpp b/libs/usb/JaRulePortHandleImpl.cpp index 5cc82baacb..088bcee554 100644 --- a/libs/usb/JaRulePortHandleImpl.cpp +++ b/libs/usb/JaRulePortHandleImpl.cpp @@ -229,7 +229,8 @@ void JaRulePortHandleImpl::MuteDeviceComplete( response->CommandClass() == RDMCommand::DISCOVER_COMMAND_RESPONSE && response->ResponseType() == rdm::RDM_ACK); } else { - OLA_INFO << "Mute failed!"; + OLA_INFO << "Mute failed! Result: " << result << ", RC: " << return_code + << ", payload size: " << payload.size(); } mute_complete->Run(muted_ok); } From 1d1d79679aead8b295e969bc2493d6b78df154bf Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 22:55:30 +0100 Subject: [PATCH 06/45] Add more E1.37-2 based RDM tests --- tools/rdm/TestDefinitions.py | 179 ++++++++++++++++++++++++++++++++++- 1 file changed, 176 insertions(+), 3 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 7ae6a68952..d8ce8d5af4 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7270,7 +7270,7 @@ class AllSubDevicesGetIPv4DHCPMode(TestMixins.AllSubDevicesGetMixin, OptionalParameterTestFixture): """Send a get IPV4_DHCP_MODE to ALL_SUB_DEVICES.""" PID = 'IPV4_DHCP_MODE' - DATA = [1] + DATA = [0x00000001] # class GetIPv4DHCPMode(TestMixins., @@ -7327,6 +7327,179 @@ class SetIPv4DHCPModeWithExtraData(TestMixins.SetWithDataMixin, DATA = 'foobar' +# IPV4_ZEROCONF_MODE +# ----------------------------------------------------------------------------- +class AllSubDevicesGetIPv4ZeroconfMode(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get IPV4_ZEROCONF_MODE to ALL_SUB_DEVICES.""" + PID = 'IPV4_ZEROCONF_MODE' + DATA = [0x00000001] + + +# class GetIPv4ZeroconfMode(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_ZEROCONF_MODE' +# TODO(peter): Test get + + +class GetZeroIPv4ZeroconfMode(TestMixins.GetZeroUInt32Mixin, + OptionalParameterTestFixture): + """GET IPV4_ZEROCONF_MODE for interface identifier 0.""" + PID = 'IPV4_ZEROCONF_MODE' + + +class GetIPv4ZeroconfModeWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET IPV4_ZEROCONF_MODE with no argument given.""" + PID = 'IPV4_ZEROCONF_MODE' + + +class GetIPv4ZeroconfModeWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET IPV4_ZEROCONF_MODE with more than 4 bytes of data.""" + PID = 'IPV4_ZEROCONF_MODE' + DATA = 'foobar' + + +# class SetIPv4ZeroconfMode(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_ZEROCONF_MODE' +# TODO(peter): Test set + + +# class SetZeroIPv4ZeroconfMode(TestMixins., +# OptionalParameterTestFixture): +# """SET IPV4_ZEROCONF_MODE to interface identifier 0.""" +# CATEGORY = TestCategory.ERROR_CONDITIONS +# PID = 'IPV4_ZEROCONF_MODE' +# TODO(peter): Test set zero + + +class SetIPv4ZeroconfModeWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set IPV4_ZEROCONF_MODE command with no data.""" + PID = 'IPV4_ZEROCONF_MODE' + + +class SetIPv4ZeroconfModeWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET IPV4_ZEROCONF_MODE command with extra data.""" + PID = 'IPV4_ZEROCONF_MODE' + DATA = 'foobar' + + +# IPV4_CURRENT_ADDRESS +# ----------------------------------------------------------------------------- +class AllSubDevicesGetIPv4CurrentAddress(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get IPV4_CURRENT_ADDRESS to ALL_SUB_DEVICES.""" + PID = 'IPV4_CURRENT_ADDRESS' + DATA = [0x00000001] + + +# class GetIPv4CurrentAddress(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_CURRENT_ADDRESS' +# TODO(peter): Test get + + +class GetZeroIPv4CurrentAddress(TestMixins.GetZeroUInt32Mixin, + OptionalParameterTestFixture): + """GET IPV4_CURRENT_ADDRESS for interface identifier 0.""" + PID = 'IPV4_CURRENT_ADDRESS' + + +class GetIPv4CurrentAddressWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET IPV4_CURRENT_ADDRESS with no argument given.""" + PID = 'IPV4_CURRENT_ADDRESS' + + +class GetIPv4CurrentAddressWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET IPV4_CURRENT_ADDRESS with more than 4 bytes of data.""" + PID = 'IPV4_CURRENT_ADDRESS' + DATA = 'foobar' + + +class SetIPv4CurrentAddress(TestMixins.UnsupportedSetMixin, + OptionalParameterTestFixture): + """Attempt to SET IPV4_CURRENT_ADDRESS.""" + PID = 'IPV4_CURRENT_ADDRESS' + + +class SetIPv4CurrentAddressWithData(TestMixins.UnsupportedSetWithDataMixin, + OptionalParameterTestFixture): + """Attempt to SET IPV4_CURRENT_ADDRESS with data.""" + PID = 'IPV4_CURRENT_ADDRESS' + + +# IPV4_STATIC_ADDRESS +# ----------------------------------------------------------------------------- +class AllSubDevicesGetIPv4StaticAddress(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get IPV4_STATIC_ADDRESS to ALL_SUB_DEVICES.""" + PID = 'IPV4_STATIC_ADDRESS' + DATA = [0x00000001] + + +# class GetIPv4StaticAddress(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_STATIC_ADDRESS' +# TODO(peter): Test get + + +class GetZeroIPv4StaticAddress(TestMixins.GetZeroUInt32Mixin, + OptionalParameterTestFixture): + """GET IPV4_STATIC_ADDRESS for interface identifier 0.""" + PID = 'IPV4_STATIC_ADDRESS' + + +class GetIPv4StaticAddressWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET IPV4_STATIC_ADDRESS with no argument given.""" + PID = 'IPV4_STATIC_ADDRESS' + + +class GetIPv4StaticAddressWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET IPV4_STATIC_ADDRESS with more than 4 bytes of data.""" + PID = 'IPV4_STATIC_ADDRESS' + DATA = 'foobar' + + +# class SetIPv4StaticAddress(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'IPV4_STATIC_ADDRESS' +# TODO(peter): Test set + + +# class SetZeroIPv4StaticAddress(TestMixins., +# OptionalParameterTestFixture): +# """SET IPV4_STATIC_ADDRESS to interface identifier 0.""" +# CATEGORY = TestCategory.ERROR_CONDITIONS +# PID = 'IPV4_STATIC_ADDRESS' +# TODO(peter): Test set zero + + +class SetIPv4StaticAddressWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set IPV4_STATIC_ADDRESS command with no data.""" + PID = 'IPV4_STATIC_ADDRESS' + + +class SetIPv4StaticAddressWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET IPV4_STATIC_ADDRESS command with extra data.""" + PID = 'IPV4_STATIC_ADDRESS' + DATA = 'foobarbazqux' + + # Interface label # ----------------------------------------------------------------------------- class GetInterfaceLabels(TestMixins.GetSettingDescriptionsListMixin, @@ -7374,7 +7547,7 @@ class AllSubDevicesGetInterfaceLabel(TestMixins.AllSubDevicesGetMixin, OptionalParameterTestFixture): """Send a get INTERFACE_LABEL to ALL_SUB_DEVICES.""" PID = 'INTERFACE_LABEL' - DATA = [1] + DATA = [0x00000001] # Interface hardware address type 1 @@ -7384,7 +7557,7 @@ class AllSubDevicesGetInterfaceHardwareAddressType1( OptionalParameterTestFixture): """Send a get INTERFACE_HARDWARE_ADDRESS_TYPE1 to ALL_SUB_DEVICES.""" PID = 'INTERFACE_HARDWARE_ADDRESS_TYPE1' - DATA = [1] + DATA = [0x00000001] # class GetInterfaceHardwareAddressType1(TestMixins., # OptionalParameterTestFixture): From 1a12b8d5416f1505fc246ff67664a374a9f28023 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 26 Apr 2017 23:13:16 +0100 Subject: [PATCH 07/45] Add some more missing tests, rename some others for clarity --- tools/rdm/TestDefinitions.py | 22 ++++++++++++++++++---- tools/rdm/TestMixins.py | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index d8ce8d5af4..dfc2cfdde5 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -4399,6 +4399,18 @@ def Test(self): self.SendSet(ROOT_DEVICE, self.pid, [1, 0, 0, 0]) +class SetZeroCapturePreset(OptionalParameterTestFixture): + """SET CAPTURE_PRESET to scene 0 and expect a data out of range.""" + CATEGORY = TestCategory.ERROR_CONDITIONS + PID = 'CAPTURE_PRESET' + + def Test(self): + self.AddIfSetSupported(self.NackSetResult(RDMNack.NR_DATA_OUT_OF_RANGE)) + # Scene 0, no timing information + data = struct.pack('!HHHH', 0, 0, 0, 0) + self.SendRawSet(ROOT_DEVICE, self.pid, data) + + class SetCapturePresetWithNoData(TestMixins.SetWithNoDataMixin, OptionalParameterTestFixture): """Set capture preset with no data.""" @@ -6639,6 +6651,7 @@ class AllSubDevicesGetPresetInfo(TestMixins.AllSubDevicesGetMixin, # ----------------------------------------------------------------------------- class GetPresetStatusPresetOff(OptionalParameterTestFixture): """Get the PRESET_STATUS for PRESET_PLAYBACK_OFF.""" + # AKA GetZeroPresetStatus CATEGORY = TestCategory.ERROR_CONDITIONS PID = 'PRESET_STATUS' @@ -6784,16 +6797,17 @@ class SetPresetStatusWithExtraData(TestMixins.SetWithDataMixin, PID = 'PRESET_STATUS' -class SetPresetStatusPresetOff(TestMixins.SetPresetStatusMixin, +class SetPresetStatusPresetOff(TestMixins.SetOutOfRangePresetStatusMixin, OptionalParameterTestFixture): """Set the PRESET_STATUS for PRESET_PLAYBACK_OFF.""" + # AKA SetZeroPresetStatus CATEGORY = TestCategory.ERROR_CONDITIONS def PresetStatusSceneNumber(self): return 0 -class SetPresetStatusPresetScene(TestMixins.SetPresetStatusMixin, +class SetPresetStatusPresetScene(TestMixins.SetOutOfRangePresetStatusMixin, OptionalParameterTestFixture): """Set the PRESET_STATUS for PRESET_PLAYBACK_SCENE.""" CATEGORY = TestCategory.ERROR_CONDITIONS @@ -6802,11 +6816,11 @@ def PresetStatusSceneNumber(self): return 0xffff -class SetOutOfRangePresetStatus(TestMixins.SetPresetStatusMixin, +class SetOutOfRangePresetStatus(TestMixins.SetOutOfRangePresetStatusMixin, OptionalParameterTestFixture): """Set the PRESET_STATUS for max_scene + 1.""" CATEGORY = TestCategory.ERROR_CONDITIONS - REQUIRES = ['max_scene_number'] + TestMixins.SetPresetStatusMixin.REQUIRES + REQUIRES = ['max_scene_number'] + TestMixins.SetOutOfRangePresetStatusMixin.REQUIRES def PresetStatusSceneNumber(self): max_scene = self.Property('max_scene_number') diff --git a/tools/rdm/TestMixins.py b/tools/rdm/TestMixins.py index bac10f3733..eed51caf3b 100644 --- a/tools/rdm/TestMixins.py +++ b/tools/rdm/TestMixins.py @@ -739,7 +739,7 @@ def _DoAction(self): # Preset Status mixins # ----------------------------------------------------------------------------- -class SetPresetStatusMixin(ResponderTestFixture): +class SetOutOfRangePresetStatusMixin(ResponderTestFixture): """Set an out of range scene for PRESET_STATUS""" PID = 'PRESET_STATUS' REQUIRES = ['preset_info'] @@ -756,7 +756,7 @@ def BuildPresetStatus(self, scene): int(wait_time), 0) def PresetStatusSceneNumber(self): - self.SetBroken('Base method of SetPresetStatusMixin called') + self.SetBroken('Base method of SetOutOfRangePresetStatusMixin called') return def Test(self): From 489411bf6400389dd7cc96792eb5b57531566b87 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 14:09:35 +0100 Subject: [PATCH 08/45] Standardise more RDM test names --- tools/rdm/TestDefinitions.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index dfc2cfdde5..306f638cbc 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -2860,6 +2860,12 @@ class SetSensorDefinition(TestMixins.UnsupportedSetMixin, PID = 'SENSOR_DEFINITION' +class SetSensorDefinitionWithData(TestMixins.UnsupportedSetWithDataMixin, + OptionalParameterTestFixture): + """Attempt to SET SENSOR_DEFINITION with data.""" + PID = 'SENSOR_DEFINITION' + + class AllSubDevicesGetSensorDefinition(TestMixins.AllSubDevicesGetMixin, OptionalParameterTestFixture): """Send a Get SENSOR_DEFINITION to ALL_SUB_DEVICES.""" @@ -3110,14 +3116,14 @@ class ResetUndefinedSensorValues(TestMixins.SetUndefinedSensorValues, REQUIRES = ['sensor_definitions'] -class ResetSensorValueWithNoData(TestMixins.SetWithNoDataMixin, +class SetSensorValueWithNoData(TestMixins.SetWithNoDataMixin, OptionalParameterTestFixture): """SET sensor value without any sensor number.""" PID = 'SENSOR_VALUE' ALLOWED_NACKS = [RDMNack.NR_UNSUPPORTED_COMMAND_CLASS] -class ResetSensorValueWithExtraData(TestMixins.SetWithDataMixin, +class SetSensorValueWithExtraData(TestMixins.SetWithDataMixin, OptionalParameterTestFixture): """Send a SET SENSOR_VALUE command with extra data.""" PID = 'SENSOR_VALUE' @@ -3215,13 +3221,13 @@ class RecordUndefinedSensorValues(TestMixins.SetUndefinedSensorValues, REQUIRES = ['sensor_definitions'] -class RecordSensorValueWithNoData(TestMixins.SetWithNoDataMixin, - OptionalParameterTestFixture): +class SetRecordSensorsWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): """SET record sensors without any sensor number.""" PID = 'RECORD_SENSORS' -class RecordSensorValueWithExtraData(TestMixins.SetWithDataMixin, +class SetRecordSensorsWithExtraData(TestMixins.SetWithDataMixin, OptionalParameterTestFixture): """Send a SET RECORD_SENSORS command with extra data.""" PID = 'RECORD_SENSORS' From a9717facf61cfa3da55188ca6c34f06e55ecefc3 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 14:10:09 +0100 Subject: [PATCH 09/45] Add more logging --- tools/usbpro/usbpro-firmware.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/usbpro/usbpro-firmware.cpp b/tools/usbpro/usbpro-firmware.cpp index 49c661f4cd..826e43054f 100644 --- a/tools/usbpro/usbpro-firmware.cpp +++ b/tools/usbpro/usbpro-firmware.cpp @@ -71,9 +71,11 @@ class FirmwareTransferer { unsigned int length); bool SendNextChunk(); void AbortTransfer() { + OLA_INFO << "Abort transfer"; m_ss->Terminate(); } void StartTransfer() { + OLA_INFO << "Start transfer"; SendNextChunk(); } bool WasSucessfull() const { return m_sucessful; } @@ -114,8 +116,10 @@ void FirmwareTransferer::HandleMessage(uint8_t label, return; if (0 == memcmp(data, REPLY_SUCCESS, sizeof(FLASH_STATUS_LENGTH))) { - if (!SendNextChunk() || m_sucessful) + if (!SendNextChunk() || m_sucessful) { + OLA_INFO << "No chunk or successful"; m_ss->Terminate(); + } } else { OLA_FATAL << "Bad response from widget:" << string((const char*) data, 4); m_ss->Terminate(); @@ -231,6 +235,7 @@ void DisplayHelpAndExit(char *argv[]) { void Stop(SelectServer *ss) { + OLA_INFO << "Stopping select server"; ss->Terminate(); } From 9b6bbe248877e2195fa5b3072e0796d1f9b62992 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 14:10:31 +0100 Subject: [PATCH 10/45] Minor code tidy --- tools/logic/logic-rdm-sniffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/logic/logic-rdm-sniffer.cpp b/tools/logic/logic-rdm-sniffer.cpp index fc1dca85a9..2def518656 100644 --- a/tools/logic/logic-rdm-sniffer.cpp +++ b/tools/logic/logic-rdm-sniffer.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -69,6 +70,7 @@ using ola::rdm::CommandPrinter; using ola::rdm::PidStoreHelper; using ola::rdm::RDMCommand; using ola::rdm::UID; +using ola::strings::ToHex; using ola::thread::Mutex; @@ -292,8 +294,8 @@ void LogicReader::DisplayAlternateFrame(const uint8_t *data, return; unsigned int slot_count = length - 1; - cout << "SC 0x" << std::hex << std::setw(2) << static_cast(data[0]) - << " " << std::dec << slot_count << ":" << std::hex; + cout << "SC " << ToHex(static_cast(data[0])) + << " " << slot_count << ":"; DisplayRawData(data + 1, slot_count); } From f92215e49cb2edb4525bc0ecd820edcf7cd381c4 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 14:11:54 +0100 Subject: [PATCH 11/45] More code tidying --- common/rdm/CommandPrinter.cpp | 59 ++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/common/rdm/CommandPrinter.cpp b/common/rdm/CommandPrinter.cpp index 84cb03f495..4cd52a57d5 100644 --- a/common/rdm/CommandPrinter.cpp +++ b/common/rdm/CommandPrinter.cpp @@ -34,6 +34,7 @@ namespace rdm { using ola::messaging::Descriptor; using ola::messaging::Message; using ola::network::NetworkToHost; +using ola::strings::ToHex; using std::auto_ptr; using std::endl; using std::string; @@ -110,13 +111,12 @@ void CommandPrinter::DisplayRequest(const RDMRequest *request, AppendPortId(request); AppendHeaderFields(request, (is_get ? "GET" : "SET")); - *m_output << " Param ID : 0x" << std::setfill('0') << std::setw(4) - << std::hex << request->ParamId(); - if (descriptor) + *m_output << " Param ID : " << ToHex(request->ParamId()); + if (descriptor) { *m_output << " (" << descriptor->Name() << ")"; + } *m_output << endl; - *m_output << " Param data len : " << std::dec << request->ParamDataSize() - << endl; + *m_output << " Param data len : " << request->ParamDataSize() << endl; DisplayParamData(descriptor, unpack_param_data, true, @@ -154,12 +154,12 @@ void CommandPrinter::DisplayResponse(const RDMResponse *response, AppendVerboseResponseType(response); AppendHeaderFields(response, (is_get ? "GET_RESPONSE" : "SET_RESPONSE")); - *m_output << " Param ID : 0x" << std::setfill('0') << std::setw(4) - << std::hex << response->ParamId(); - if (descriptor) + *m_output << " Param ID : " << ToHex(response->ParamId()); + if (descriptor) { *m_output << " (" << descriptor->Name() << ")"; + } *m_output << endl; - *m_output << " Param data len : " << std::dec << response->ParamDataSize() + *m_output << " Param data len : " << response->ParamDataSize() << endl; DisplayParamData(descriptor, unpack_param_data, @@ -182,6 +182,8 @@ void CommandPrinter::DisplayDiscoveryRequest( const RDMDiscoveryRequest *request, bool summarize, bool unpack_param_data) { + // We can't just get a descriptor here like the other code as we don't store + // them for discovery commands string param_name; switch (request->ParamId()) { case ola::rdm::PID_DISC_UNIQUE_BRANCH: @@ -216,10 +218,10 @@ void CommandPrinter::DisplayDiscoveryRequest( AppendPortId(request); AppendHeaderFields(request, "DISCOVERY_COMMAND"); - *m_output << " Param ID : 0x" << std::setfill('0') << std::setw(4) - << std::hex << request->ParamId(); - if (!param_name.empty()) + *m_output << " Param ID : " << ToHex(request->ParamId()); + if (!param_name.empty()) { *m_output << " (" << param_name << ")"; + } *m_output << endl; *m_output << " Param data len : " << std::dec << request->ParamDataSize() << endl; @@ -244,6 +246,8 @@ void CommandPrinter::DisplayDiscoveryResponse( const RDMDiscoveryResponse *response, bool summarize, bool unpack_param_data) { + // We can't just get a descriptor here like the other code as we don't store + // them for discovery commands string param_name; switch (response->ParamId()) { case ola::rdm::PID_DISC_UNIQUE_BRANCH: @@ -259,10 +263,10 @@ void CommandPrinter::DisplayDiscoveryResponse( if (summarize) { AppendUIDsAndType(response, "DISCOVERY_COMMAND_RESPONSE"); - *m_output << ", PID 0x" << std::hex << std::setfill('0') << std::setw(4) << - response->ParamId(); - if (!param_name.empty()) + *m_output << ", PID " << ToHex(response->ParamId()); + if (!param_name.empty()) { *m_output << " (" << param_name << ")"; + } if (response->ParamId() == ola::rdm::PID_DISC_UNIQUE_BRANCH && response->ParamDataSize() == 2 * UID::UID_SIZE) { const uint8_t *param_data = response->ParamData(); @@ -270,7 +274,7 @@ void CommandPrinter::DisplayDiscoveryResponse( UID upper(param_data + UID::UID_SIZE); *m_output << ", (" << lower << ", " << upper << ")"; } else { - *m_output << ", pdl: " << std::dec << response->ParamDataSize(); + *m_output << ", pdl: " << response->ParamDataSize(); } *m_output << endl; } else { @@ -278,12 +282,12 @@ void CommandPrinter::DisplayDiscoveryResponse( AppendVerboseResponseType(response); AppendHeaderFields(response, "DISCOVERY_COMMAND_RESPONSE"); - *m_output << " Param ID : 0x" << std::setfill('0') << std::setw(4) - << std::hex << response->ParamId(); - if (!param_name.empty()) + *m_output << " Param ID : " << ToHex(response->ParamId()); + if (!param_name.empty()) { *m_output << " (" << param_name << ")"; + } *m_output << endl; - *m_output << " Param data len : " << std::dec << response->ParamDataSize() + *m_output << " Param data len : " << response->ParamDataSize() << endl; DisplayParamData(NULL, unpack_param_data, @@ -357,10 +361,9 @@ void CommandPrinter::AppendVerboseResponseType( void CommandPrinter::AppendHeaderFields( const RDMCommand *command, const char *command_class) { - *m_output << " Message count : " << std::dec << - static_cast(command->MessageCount()) << endl; - *m_output << " Sub device : " << std::dec << command->SubDevice() - << endl; + *m_output << " Message count : " + << static_cast(command->MessageCount()) << endl; + *m_output << " Sub device : " << command->SubDevice() << endl; *m_output << " Command class : " << command_class << endl; } @@ -370,11 +373,11 @@ void CommandPrinter::AppendHeaderFields( */ void CommandPrinter::AppendPidString(const RDMCommand *command, const PidDescriptor *descriptor) { - *m_output << "PID 0x" << std::hex << std::setfill('0') << std::setw(4) << - command->ParamId(); - if (descriptor) + *m_output << "PID " << ToHex(command->ParamId()); + if (descriptor) { *m_output << " (" << descriptor->Name() << ")"; - *m_output << ", pdl: " << std::dec << command->ParamDataSize() << endl; + } + *m_output << ", pdl: " << command->ParamDataSize() << endl; } From 98d3e15909d991eda32f80bad7710e6b609c81cd Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 15:15:51 +0100 Subject: [PATCH 12/45] Don't fail when we get some duff data, just move on --- tools/rdm/ModelCollector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/rdm/ModelCollector.py b/tools/rdm/ModelCollector.py index fcc580f82c..2445ca723f 100644 --- a/tools/rdm/ModelCollector.py +++ b/tools/rdm/ModelCollector.py @@ -509,8 +509,9 @@ def _RDMRequestComplete(self, response, unpacked_data, unpack_exception): (response.pid, response.nack_reason)) self._NextState() elif unpack_exception: - print unpack_exception - self.wrapper.Stop() + print ('Unpack error: %s' % (unpack_exception)) + self._NextState() + #self.wrapper.Stop() else: self._HandleResponse(unpacked_data) From a261d25a9d89aacd6d088b233704425c71611451 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 15:16:15 +0100 Subject: [PATCH 13/45] Be more strict on this error, after chatting to Richard from ETC --- tools/rdm/TestDefinitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 306f638cbc..b47084a9d9 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -2626,7 +2626,7 @@ def VerifyResult(self, response, fields): for slot in fields['slot_values']: if slot['slot_offset'] not in defined_slots: - self.AddAdvisory( + self.AddWarning( "DEFAULT_SLOT_VALUE contained slot %d, which wasn't in SLOT_INFO" % slot['slot_offset']) default_slots.add(slot['slot_offset']) From 1c75d78387f5383d1e9ae9576eaecac269e9fdb3 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 17:02:22 +0100 Subject: [PATCH 14/45] Update some readme files --- plugins/usbpro/README.md | 1 + tools/logic/README.md | 4 ++++ tools/rdmpro/README.md | 1 + 3 files changed, 6 insertions(+) create mode 100644 tools/rdmpro/README.md diff --git a/plugins/usbpro/README.md b/plugins/usbpro/README.md index 483e5d14db..d3a092fb51 100644 --- a/plugins/usbpro/README.md +++ b/plugins/usbpro/README.md @@ -10,6 +10,7 @@ includes: * DMXter4, DMXter4A & mini DMXter * Enttec DMX USB Pro & USB Pro Mk II * Robe Universe Interface +* Lumenradio See https://wiki.openlighting.org/index.php/USB_Protocol_Extensions for more info. diff --git a/tools/logic/README.md b/tools/logic/README.md index 9dcaf0a9c5..619d5fab74 100644 --- a/tools/logic/README.md +++ b/tools/logic/README.md @@ -1,3 +1,7 @@ +This currently only works with the original Saleae Logic and Logic 16. +The more recent Logic 4, Logic 8, Logic Pro 8 and Logic Pro 16 are not supported by the SDK. +http://support.saleae.com/hc/en-us/articles/210245633-Device-SDK-status-for-the-new-products + In order to compile the logic rdm sniffer, you need to set the include path to your SaleaeDeviceSDK. Example: ``` diff --git a/tools/rdmpro/README.md b/tools/rdmpro/README.md new file mode 100644 index 0000000000..b53a201705 --- /dev/null +++ b/tools/rdmpro/README.md @@ -0,0 +1 @@ +This currently only works with the Enttec RDM USB Pro and not the DMX USB Pro Mk2. From fe0ced39891c34eebb4ab4717ce94b28eb5e869b Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 18:32:10 +0100 Subject: [PATCH 15/45] GDS Pids, need pushing to website --- data/rdm/manufacturer_pids.proto | 93 +++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index 1a9fa4c796..29c9ffcdcf 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -8578,4 +8578,95 @@ manufacturer { set_sub_device_range: ROOT_DEVICE } } -version: 1458491190 +manufacturer { + manufacturer_id: 13364 + manufacturer_name: "Global Design Solutions, Ltd." + pid { + name: "SERIAL_NUMBER" + value: 0xffdf + get_request { + } + get_response { + field { + type: UINT32 + name: "serial_number" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "LED_DRIVE_CURRENT" + value: 0x8020 + get_request { + field { + type: UINT8 + name: "channel" + label { + value: 0xff + label: "All" + } + range { + min: 1 + max: 4 + } + } + } + get_response { + field { + type: UINT8 + name: "channel" + label { + value: 0x00 + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + get_sub_device_range: ROOT_DEVICE + set_request { + field { + type: UINT8 + name: "channel" + label { + value: 0xff + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + set_response { + field { + type: UINT8 + name: "channel" + label { + value: 0x00 + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + set_sub_device_range: ROOT_DEVICE + } +} +version: 1458491191 From a7c3d2d0fdab22ccd97d6642b6bb8d45d715b440 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 22:04:33 +0100 Subject: [PATCH 16/45] SPaG --- common/protocol/Ola.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/protocol/Ola.proto b/common/protocol/Ola.proto index 30eb80ac6c..304ee1d589 100644 --- a/common/protocol/Ola.proto +++ b/common/protocol/Ola.proto @@ -83,7 +83,7 @@ enum PluginIds { enum RDMResponseCode { // The request/response completed correctly RDM_COMPLETED_OK = 0; - // The request was broadcast, no respone expected + // The request was broadcast, no response expected RDM_WAS_BROADCAST = 1; // We failed to send this request RDM_FAILED_TO_SEND = 2; From fd7b0b71a878e9691f5ead0d01713527c6621219 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 27 Apr 2017 23:16:39 +0100 Subject: [PATCH 17/45] Pretty print DUB messages --- common/rdm/CommandPrinter.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/common/rdm/CommandPrinter.cpp b/common/rdm/CommandPrinter.cpp index 4cd52a57d5..01ce8557fd 100644 --- a/common/rdm/CommandPrinter.cpp +++ b/common/rdm/CommandPrinter.cpp @@ -199,8 +199,7 @@ void CommandPrinter::DisplayDiscoveryRequest( if (summarize) { AppendUIDsAndType(request, "DISCOVERY_COMMAND"); - *m_output << ", PID 0x" << std::hex << std::setfill('0') << std::setw(4) << - request->ParamId(); + *m_output << ", PID " << ToHex(request->ParamId()); if (!param_name.empty()) *m_output << " (" << param_name << ")"; if (request->ParamId() == ola::rdm::PID_DISC_UNIQUE_BRANCH && @@ -224,13 +223,22 @@ void CommandPrinter::DisplayDiscoveryRequest( } *m_output << endl; *m_output << " Param data len : " << std::dec << request->ParamDataSize() - << endl; - DisplayParamData(NULL, - unpack_param_data, - true, - false, - request->ParamData(), - request->ParamDataSize()); + << endl; + if (request->ParamId() == ola::rdm::PID_DISC_UNIQUE_BRANCH && + request->ParamDataSize() == 2 * UID::UID_SIZE) { + const uint8_t *param_data = request->ParamData(); + UID lower(param_data); + UID upper(param_data + UID::UID_SIZE); + *m_output << " Lower UID : " << lower << endl; + *m_output << " Upper UID : " << upper << endl; + } else { + DisplayParamData(NULL, + unpack_param_data, + true, + false, + request->ParamData(), + request->ParamDataSize()); + } } } @@ -288,7 +296,7 @@ void CommandPrinter::DisplayDiscoveryResponse( } *m_output << endl; *m_output << " Param data len : " << response->ParamDataSize() - << endl; + << endl; DisplayParamData(NULL, unpack_param_data, true, From 40a01d1eb6447fd136c6f5955c6fab9a9ae86dc4 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 08:14:50 +0100 Subject: [PATCH 18/45] Add more E1.37-2 tests --- tools/rdm/TestDefinitions.py | 142 +++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index b47084a9d9..3c2dca0a73 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7520,6 +7520,148 @@ class SetIPv4StaticAddressWithExtraData(TestMixins.SetWithDataMixin, DATA = 'foobarbazqux' +# INTERFACE_RENEW_DHCP +# ----------------------------------------------------------------------------- +class AllSubDevicesGetInterfaceRenewDHCP( + TestMixins.AllSubDevicesUnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to send a get INTERFACE_RENEW_DHCP to ALL_SUB_DEVICES.""" + PID = 'INTERFACE_RENEW_DHCP' + + +class GetInterfaceRenewDHCP(TestMixins.UnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to GET INTERFACE_RENEW_DHCP.""" + PID = 'INTERFACE_RENEW_DHCP' + + +class GetInterfaceRenewDHCPWithData(TestMixins.UnsupportedGetWithDataMixin, + OptionalParameterTestFixture): + """GET INTERFACE_RENEW_DHCP with data.""" + PID = 'INTERFACE_RENEW_DHCP' + + +# class SetInterfaceRenewDHCP(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'INTERFACE_RENEW_DHCP' +# TODO(peter): Test set + + +class SetZeroInterfaceRenewDHCP(TestMixins.SetZeroUInt32Mixin, + OptionalParameterTestFixture): + """SET INTERFACE_RENEW_DHCP to interface identifier 0.""" + PID = 'INTERFACE_RENEW_DHCP' + + +class SetInterfaceRenewDHCPWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set INTERFACE_RENEW_DHCP command with no data.""" + PID = 'INTERFACE_RENEW_DHCP' + + +class SetInterfaceRenewDHCPWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET INTERFACE_RENEW_DHCP command with extra data.""" + PID = 'INTERFACE_RENEW_DHCP' + DATA = 'foobar' + + +# INTERFACE_RELEASE_DHCP +# ----------------------------------------------------------------------------- +class AllSubDevicesGetInterfaceReleaseDHCP( + TestMixins.AllSubDevicesUnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to send a get INTERFACE_RELEASE_DHCP to ALL_SUB_DEVICES.""" + PID = 'INTERFACE_RELEASE_DHCP' + + +class GetInterfaceReleaseDHCP(TestMixins.UnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to GET INTERFACE_RELEASE_DHCP.""" + PID = 'INTERFACE_RELEASE_DHCP' + + +class GetInterfaceReleaseDHCPWithData(TestMixins.UnsupportedGetWithDataMixin, + OptionalParameterTestFixture): + """GET INTERFACE_RELEASE_DHCP with data.""" + PID = 'INTERFACE_RELEASE_DHCP' + + +# class SetInterfaceReleaseDHCP(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'INTERFACE_RELEASE_DHCP' +# TODO(peter): Test set + + +class SetZeroInterfaceReleaseDHCP(TestMixins.SetZeroUInt32Mixin, + OptionalParameterTestFixture): + """SET INTERFACE_RELEASE_DHCP to interface identifier 0.""" + PID = 'INTERFACE_RELEASE_DHCP' + + +class SetInterfaceReleaseDHCPWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set INTERFACE_RELEASE_DHCP command with no data.""" + PID = 'INTERFACE_RELEASE_DHCP' + + +class SetInterfaceReleaseDHCPWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET INTERFACE_RELEASE_DHCP command with extra data.""" + PID = 'INTERFACE_RELEASE_DHCP' + DATA = 'foobar' + + +# INTERFACE_APPLY_CONFIGURATION +# ----------------------------------------------------------------------------- +class AllSubDevicesGetInterfaceApplyConfiguration( + TestMixins.AllSubDevicesUnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to send a get INTERFACE_APPLY_CONFIGURATION to ALL_SUB_DEVICES.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + + +class GetInterfaceApplyConfiguration(TestMixins.UnsupportedGetMixin, + OptionalParameterTestFixture): + """Attempt to GET INTERFACE_APPLY_CONFIGURATION.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + + +class GetInterfaceApplyConfigurationWithData( + TestMixins.UnsupportedGetWithDataMixin, + OptionalParameterTestFixture): + """GET INTERFACE_APPLY_CONFIGURATION with data.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + + +# class SetInterfaceApplyConfiguration(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'INTERFACE_APPLY_CONFIGURATION' +# TODO(peter): Test set + + +class SetZeroInterfaceApplyConfiguration(TestMixins.SetZeroUInt32Mixin, + OptionalParameterTestFixture): + """SET INTERFACE_APPLY_CONFIGURATION to interface identifier 0.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + + +class SetInterfaceApplyConfigurationWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set INTERFACE_APPLY_CONFIGURATION command with no data.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + + +class SetInterfaceApplyConfigurationWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET INTERFACE_APPLY_CONFIGURATION command with extra data.""" + PID = 'INTERFACE_APPLY_CONFIGURATION' + DATA = 'foobar' + + # Interface label # ----------------------------------------------------------------------------- class GetInterfaceLabels(TestMixins.GetSettingDescriptionsListMixin, From d682b7a1a429cdc23147e72589716e49da96edfa Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 08:49:01 +0100 Subject: [PATCH 19/45] Add a few more SetZero tests --- tools/rdm/TestDefinitions.py | 65 +++++++++++++++++++++++++++--------- tools/rdm/TestMixins.py | 30 +++++++++++++---- 2 files changed, 73 insertions(+), 22 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 3c2dca0a73..c46c4b53f6 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7165,6 +7165,23 @@ class GetDNSHostnameWithData(TestMixins.GetWithDataMixin, # TODO(Peter): Need to test set +# class SetDNSHostname(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION +# PID = 'DNS_HOSTNAME' +# TODO(peter): Test set + + +class SetDNSHostnameWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set DNS_HOSTNAME command with no data.""" + PID = 'DNS_HOSTNAME' + + +class SetDNSHostnameWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET DNS_HOSTNAME command with extra data.""" + PID = 'DNS_HOSTNAME' class AllSubDevicesGetDNSHostname(TestMixins.AllSubDevicesGetMixin, @@ -7192,6 +7209,23 @@ class GetDNSDomainNameWithData(TestMixins.GetWithDataMixin, # TODO(Peter): Need to test set +# class SetDNSDomainName(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION +# PID = 'DNS_DOMAIN_NAME' +# TODO(peter): Test set + + +class SetDNSDomainNameWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set DNS_DOMAIN_NAME command with no data.""" + PID = 'DNS_DOMAIN_NAME' + + +class SetDNSDomainNameWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET DNS_DOMAIN_NAME command with extra data.""" + PID = 'DNS_DOMAIN_NAME' class AllSubDevicesGetDNSDomainName(TestMixins.AllSubDevicesGetMixin, @@ -7295,7 +7329,7 @@ class AllSubDevicesGetIPv4DHCPMode(TestMixins.AllSubDevicesGetMixin, # class GetIPv4DHCPMode(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_DHCP_MODE' # TODO(peter): Test get @@ -7321,17 +7355,16 @@ class GetIPv4DHCPModeWithExtraData(TestMixins.GetWithDataMixin, # class SetIPv4DHCPMode(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_DHCP_MODE' # TODO(peter): Test set -# class SetZeroIPv4DHCPMode(TestMixins., -# OptionalParameterTestFixture): -# """SET IPV4_DHCP_MODE to interface identifier 0.""" -# CATEGORY = TestCategory.ERROR_CONDITIONS -# PID = 'IPV4_DHCP_MODE' -# TODO(peter): Test set zero +class SetZeroIPv4DHCPMode(TestMixins.SetZeroMixin, + OptionalParameterTestFixture): + """SET IPV4_DHCP_MODE to interface identifier 0.""" + PID = 'IPV4_DHCP_MODE' + DATA = struct.pack('!IB', 0x00000000, 0x00) class SetIPv4DHCPModeWithNoData(TestMixins.SetWithNoDataMixin, @@ -7358,7 +7391,7 @@ class AllSubDevicesGetIPv4ZeroconfMode(TestMixins.AllSubDevicesGetMixin, # class GetIPv4ZeroconfMode(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_ZEROCONF_MODE' # TODO(peter): Test get @@ -7384,7 +7417,7 @@ class GetIPv4ZeroconfModeWithExtraData(TestMixins.GetWithDataMixin, # class SetIPv4ZeroconfMode(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_ZEROCONF_MODE' # TODO(peter): Test set @@ -7421,7 +7454,7 @@ class AllSubDevicesGetIPv4CurrentAddress(TestMixins.AllSubDevicesGetMixin, # class GetIPv4CurrentAddress(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_CURRENT_ADDRESS' # TODO(peter): Test get @@ -7468,7 +7501,7 @@ class AllSubDevicesGetIPv4StaticAddress(TestMixins.AllSubDevicesGetMixin, # class GetIPv4StaticAddress(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_STATIC_ADDRESS' # TODO(peter): Test get @@ -7494,7 +7527,7 @@ class GetIPv4StaticAddressWithExtraData(TestMixins.GetWithDataMixin, # class SetIPv4StaticAddress(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'IPV4_STATIC_ADDRESS' # TODO(peter): Test set @@ -7543,7 +7576,7 @@ class GetInterfaceRenewDHCPWithData(TestMixins.UnsupportedGetWithDataMixin, # class SetInterfaceRenewDHCP(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'INTERFACE_RENEW_DHCP' # TODO(peter): Test set @@ -7590,7 +7623,7 @@ class GetInterfaceReleaseDHCPWithData(TestMixins.UnsupportedGetWithDataMixin, # class SetInterfaceReleaseDHCP(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'INTERFACE_RELEASE_DHCP' # TODO(peter): Test set @@ -7638,7 +7671,7 @@ class GetInterfaceApplyConfigurationWithData( # class SetInterfaceApplyConfiguration(TestMixins., # OptionalParameterTestFixture): -# CATEGORY = TestCategory. +# CATEGORY = TestCategory.IP_DNS_CONFIGURATION # PID = 'INTERFACE_APPLY_CONFIGURATION' # TODO(peter): Test set diff --git a/tools/rdm/TestMixins.py b/tools/rdm/TestMixins.py index eed51caf3b..b8cddda66c 100644 --- a/tools/rdm/TestMixins.py +++ b/tools/rdm/TestMixins.py @@ -1016,16 +1016,25 @@ def ResetState(self): self._wrapper.Run() -class GetZeroUInt8Mixin(ResponderTestFixture): - """Get a UInt8 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" +class GetZeroMixin(ResponderTestFixture): + """Send a get to index 0, expect NR_DATA_OUT_OF_RANGE""" CATEGORY = TestCategory.ERROR_CONDITIONS - DATA = struct.pack('!B', 0) + DATA = None def Test(self): + if self.DATA is None: + self.SetBroken('No DATA given for %s' % self.__class__.__name__) + return + self.AddIfGetSupported(self.NackGetResult(RDMNack.NR_DATA_OUT_OF_RANGE)) self.SendRawGet(ROOT_DEVICE, self.pid, self.DATA) +class GetZeroUInt8Mixin(GetZeroMixin): + """Get a UInt8 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" + DATA = struct.pack('!B', 0) + + class GetZeroUInt16Mixin(GetZeroUInt8Mixin): """Get a UInt16 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" DATA = struct.pack('!H', 0) @@ -1036,16 +1045,25 @@ class GetZeroUInt32Mixin(GetZeroUInt8Mixin): DATA = struct.pack('!I', 0) -class SetZeroUInt8Mixin(ResponderTestFixture): - """Set a UInt8 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" +class SetZeroMixin(ResponderTestFixture): + """Send a set to index 0, expect NR_DATA_OUT_OF_RANGE""" CATEGORY = TestCategory.ERROR_CONDITIONS - DATA = struct.pack('!B', 0) + DATA = None def Test(self): + if self.DATA is None: + self.SetBroken('No DATA given for %s' % self.__class__.__name__) + return + self.AddIfSetSupported(self.NackSetResult(RDMNack.NR_DATA_OUT_OF_RANGE)) self.SendRawSet(ROOT_DEVICE, self.pid, self.DATA) +class SetZeroUInt8Mixin(SetZeroMixin): + """Set a UInt8 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" + DATA = struct.pack('!B', 0) + + class SetZeroUInt16Mixin(SetZeroUInt8Mixin): """Set a UInt16 parameter with value 0, expect NR_DATA_OUT_OF_RANGE""" DATA = struct.pack('!H', 0) From abe7ca5c53a08ce239b99fcc6b9a0dafef09c328 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 12:25:52 +0100 Subject: [PATCH 20/45] Add message length to CommandPrinter --- common/rdm/CommandPrinter.cpp | 8 ++++++++ include/ola/rdm/CommandPrinter.h | 1 + 2 files changed, 9 insertions(+) diff --git a/common/rdm/CommandPrinter.cpp b/common/rdm/CommandPrinter.cpp index 01ce8557fd..670f2c8532 100644 --- a/common/rdm/CommandPrinter.cpp +++ b/common/rdm/CommandPrinter.cpp @@ -325,6 +325,12 @@ void CommandPrinter::AppendPortId(const class RDMRequest *request) { } +void CommandPrinter::AppendMessageLength(const class RDMRequest *request) { + *m_output << " Message Length : " << std::dec << + static_cast(request->MessageLength()) << endl; +} + + void CommandPrinter::AppendVerboseUIDs(const class RDMCommand *command) { *m_output << " Source UID : " << command->SourceUID() << endl; *m_output << " Dest UID : " << command->DestinationUID() << endl; @@ -372,6 +378,8 @@ void CommandPrinter::AppendHeaderFields( *m_output << " Message count : " << static_cast(command->MessageCount()) << endl; *m_output << " Sub device : " << command->SubDevice() << endl; + *m_output << " Message length : " + << static_cast(command->MessageLength()) << endl; *m_output << " Command class : " << command_class << endl; } diff --git a/include/ola/rdm/CommandPrinter.h b/include/ola/rdm/CommandPrinter.h index 0a43c5cec4..3e53c381b3 100644 --- a/include/ola/rdm/CommandPrinter.h +++ b/include/ola/rdm/CommandPrinter.h @@ -74,6 +74,7 @@ class CommandPrinter { void AppendUIDsAndType(const class RDMCommand *command, const char *message_type); void AppendPortId(const class RDMRequest *request); + void AppendMessageLength(const class RDMRequest *request); void AppendVerboseUIDs(const class RDMCommand *command); void AppendPidString(const class RDMCommand *command, const class PidDescriptor *pid_descriptor); From e8720f9493b1a39b5fbb06be75852c267d166155 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 12:30:10 +0100 Subject: [PATCH 21/45] Confirm sub dev ranges --- data/rdm/manufacturer_pids.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index 29c9ffcdcf..e685a536f0 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -8629,7 +8629,7 @@ manufacturer { name: "value" } } - get_sub_device_range: ROOT_DEVICE + get_sub_device_range: ROOT_OR_SUBDEVICE set_request { field { type: UINT8 @@ -8666,7 +8666,7 @@ manufacturer { name: "value" } } - set_sub_device_range: ROOT_DEVICE + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE } } version: 1458491191 From d9a1e103b629153129f5d97a4661c33b1df68df8 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 19:01:08 +0100 Subject: [PATCH 22/45] Use our new mixin when generating code --- tools/rdm/list_rdm_tests.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/rdm/list_rdm_tests.py b/tools/rdm/list_rdm_tests.py index 3c27d58767..7840a1a173 100755 --- a/tools/rdm/list_rdm_tests.py +++ b/tools/rdm/list_rdm_tests.py @@ -167,10 +167,9 @@ def GetZero(names, pid, pid_test_base_name, first_atom): else: if len(pid.GetRequest(PidStore.RDM_GET).GetAtoms()) > 1: GenerateClassHeader(True, 'GetZero', pid_test_base_name, '', - ['TestMixins.', 'OptionalParameterTestFixture']) + ['TestMixins.GetZero', 'OptionalParameterTestFixture']) print('# """GET %s for %s 0."""' % (pid.name, first_atom.name.replace('_', ' '))) - print('# CATEGORY = TestCategory.ERROR_CONDITIONS') print('# PID = \'%s\'' % (pid.name)) print('# TODO(%s): Test get zero' % (getpass.getuser())) else: @@ -229,10 +228,10 @@ def SetZero(names, pid, pid_test_base_name, first_atom): else: if len(pid.GetRequest(PidStore.RDM_SET).GetAtoms()) > 1: GenerateClassHeader(True, 'SetZero', pid_test_base_name, '', - ['TestMixins.', 'OptionalParameterTestFixture']) - print('# """SET %s to %s 0."""' % + ['TestMixins.SetZero', + 'OptionalParameterTestFixture']) + print('# """SET %s for %s 0."""' % (pid.name, first_atom.name.replace('_', ' '))) - print('# CATEGORY = TestCategory.ERROR_CONDITIONS') print('# PID = \'%s\'' % (pid.name)) print('# TODO(%s): Test set zero' % (getpass.getuser())) else: From c8f5e38e493b2b831972a8cb76eb45b4d465274d Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 28 Apr 2017 19:02:47 +0100 Subject: [PATCH 23/45] More ETC Manufacturer PIDs to backport to the website --- data/rdm/manufacturer_pids.proto | 325 ++++++++++++++++++++++++++++++- 1 file changed, 324 insertions(+), 1 deletion(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index e685a536f0..f2450e2663 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -8418,6 +8418,329 @@ manufacturer { } get_sub_device_range: ROOT_OR_SUBDEVICE } + pid { + name: "ETC_OVER_TEMP_MODE_DESCRIPTION" + value: 33048 + get_request { + field { + type: UINT8 + name: "over_temperature_mode" + } + } + get_response { + field { + type: UINT8 + name: "over_temperature_mode" + } + field { + type: STRING + name: "description" + max_size: 32 + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_SEQUENCE_PLAYBACK" + value: 33055 + get_request { + } + get_response { + field { + type: UINT16 + name: "sequence" + label { + value: 0 + label: "Off" + } + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT16 + name: "sequence" + label { + value: 0 + label: "Off" + } + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_SEQUENCE_CONFIG" + value: 33056 + get_request { + } + get_response { + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_LOW_POWER_TIMEOUT" + value: 33057 + get_request { + } + get_response { + field { + type: UINT8 + name: "low_power_timeout" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT8 + name: "low_power_timeout" + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_LOW_POWER_TIMEOUT_DESCRIPTION" + value: 33058 + get_request { + field { + type: UINT8 + name: "low_power_timeout" + } + } + get_response { + field { + type: UINT8 + name: "low_power_timeout" + } + field { + type: STRING + name: "description" + max_size: 32 + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_LED_FREQUENCY_ENUM" + value: 33059 + get_request { + } + get_response { + field { + type: UINT8 + name: "frequency" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT8 + name: "frequency" + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_LED_FREQUENCY_ENUM_DESCRIPTION" + value: 33060 + get_request { + field { + type: UINT8 + name: "frequency" + } + } + get_response { + field { + type: UINT8 + name: "frequency" + } + field { + type: STRING + name: "description" + max_size: 32 + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_PRESET_CONFIG" + value: 33061 + get_request { + } + get_response { + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_HAS_ENUM_TEXT" + value: 36865 + get_request { + } + get_response { + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_GET_ENUM_TEXT" + value: 36866 + get_request { + } + get_response { + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_POWER_COMMAND" + value: 40960 + get_request { + } + get_response { + field { + type: UINT8 + name: "power_command" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT8 + name: "power_command" + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_POWER_COMMAND_DESCRIPTION" + value: 40961 + get_request { + field { + type: UINT8 + name: "power_command" + } + } + get_response { + field { + type: UINT8 + name: "power_command" + } + field { + type: STRING + name: "description" + max_size: 32 + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "ETC_DALI_SHORT_ADDRESS" + value: 40964 + get_request { + } + get_response { + field { + type: UINT8 + name: "dali_short_address" + range { + min: 0 + max: 63 + } + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT8 + name: "dali_short_address" + range { + min: 0 + max: 63 + } + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_DALI_GROUP_MEMBERSHIP" + value: 40965 + get_request { + } + get_response { + field { + type: UINT16 + name: "dali_group_membership" + #bitset + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT16 + name: "dali_short_address" + #bitset + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_AUTOBIND" + value: 40966 + get_request { + } + get_response { + field { + type: BOOL + name: "autobind" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: BOOL + name: "autobind" + } + } + set_response { + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } + pid { + name: "ETC_DELETE_SUBDEVICE" + value: 40967 + set_request { + field { + type: UINT16 + name: "subdevice_number" + range { + min: 1 + max: 512 + } + } + } + set_response { + } + set_sub_device_range: ROOT_DEVICE + } pid { name: "ETC_PREPARE_FOR_SOFTWARE_DOWNLOAD" value: 61440 @@ -8669,4 +8992,4 @@ manufacturer { set_sub_device_range: ROOT_OR_ALL_SUBDEVICE } } -version: 1458491191 +version: 1458491192 From 7b4d5f729697edda66b487f4c5aa6a7792fe7667 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 21 May 2017 23:05:07 +0100 Subject: [PATCH 24/45] Fix some flake8 issues --- tools/rdm/ModelCollector.py | 1 - tools/rdm/TestDefinitions.py | 44 ------------------------------------ tools/rdm/TestMixins.py | 6 +++-- tools/rdm/list_rdm_tests.py | 3 ++- 4 files changed, 6 insertions(+), 48 deletions(-) diff --git a/tools/rdm/ModelCollector.py b/tools/rdm/ModelCollector.py index 2445ca723f..fd8f41f185 100644 --- a/tools/rdm/ModelCollector.py +++ b/tools/rdm/ModelCollector.py @@ -511,7 +511,6 @@ def _RDMRequestComplete(self, response, unpacked_data, unpack_exception): elif unpack_exception: print ('Unpack error: %s' % (unpack_exception)) self._NextState() - #self.wrapper.Stop() else: self._HandleResponse(unpacked_data) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index c46c4b53f6..a089746a99 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -1883,50 +1883,6 @@ class GetDMXPersonalityWithData(TestMixins.GetWithDataMixin, PID = 'DMX_PERSONALITY' -class GetDMXPersonalityDescriptions(OptionalParameterTestFixture): - """Get information about all the personalities.""" - CATEGORY = TestCategory.DMX_SETUP - PID = 'DMX_PERSONALITY_DESCRIPTION' - REQUIRES = ['personality_count'] - PROVIDES = ['personalities'] - - def Test(self): - self._personalities = [] - self._personality_count = self.Property('personality_count') - self._current_index = 0 - self._GetPersonality() - - def _GetPersonality(self): - self._current_index += 1 - if self._current_index > self._personality_count: - if self._personality_count == 0: - self.SetNotRun('No personalities declared') - self.SetProperty('personalities', self._personalities) - self.Stop() - return - - if self._current_index >= MAX_PERSONALITY_NUMBER: - # This should never happen because personality_count is a uint8 - self.SetFailed('Could not find all personalities') - return - - self.AddIfGetSupported(self.AckGetResult( - field_names=['slots_required', 'name'], - field_values={'personality': self._current_index}, - action=self._GetPersonality)) - self.SendGet(ROOT_DEVICE, self.pid, [self._current_index]) - - def VerifyResult(self, response, fields): - """Save the personality for other tests to use.""" - if response.WasAcked(): - self._personalities.append(fields) - - if ContainsUnprintable(fields['name']): - self.AddAdvisory( - 'Name field in %s contains unprintable characters, was %s' % - (self.pid.name, fields['name'].encode('string-escape'))) - - class SetDMXPersonality(OptionalParameterTestFixture): """Set the personality.""" CATEGORY = TestCategory.DMX_SETUP diff --git a/tools/rdm/TestMixins.py b/tools/rdm/TestMixins.py index b8cddda66c..7a97ced662 100644 --- a/tools/rdm/TestMixins.py +++ b/tools/rdm/TestMixins.py @@ -317,7 +317,8 @@ class SetWithDataMixin(ResponderTestFixture): def Test(self): results = [ self.NackSetResult(RDMNack.NR_FORMAT_ERROR), - self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), # Fix this, ideally we change behaviour based on past support of the PID + # Fix this, ideally we change behaviour based on past support of the PID + self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), self.AckSetResult( warning='Set %s with data returned an ack' % self.pid.name) ] @@ -335,7 +336,8 @@ class SetWithNoDataMixin(ResponderTestFixture): def Test(self): results = [ - self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), # Fix this, ideally we change behaviour based on past support of the PID + # Fix this, ideally we change behaviour based on past support of the PID + self.NackSetResult(RDMNack.NR_UNSUPPORTED_COMMAND_CLASS), self.NackSetResult(RDMNack.NR_FORMAT_ERROR) ] self.AddIfSetSupported(results) diff --git a/tools/rdm/list_rdm_tests.py b/tools/rdm/list_rdm_tests.py index 7840a1a173..5ea5cdb590 100755 --- a/tools/rdm/list_rdm_tests.py +++ b/tools/rdm/list_rdm_tests.py @@ -167,7 +167,8 @@ def GetZero(names, pid, pid_test_base_name, first_atom): else: if len(pid.GetRequest(PidStore.RDM_GET).GetAtoms()) > 1: GenerateClassHeader(True, 'GetZero', pid_test_base_name, '', - ['TestMixins.GetZero', 'OptionalParameterTestFixture']) + ['TestMixins.GetZero', + 'OptionalParameterTestFixture']) print('# """GET %s for %s 0."""' % (pid.name, first_atom.name.replace('_', ' '))) print('# PID = \'%s\'' % (pid.name)) From 72e03f827e7b6d9781229f3d500b20227dfb202f Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 10 Jun 2017 17:00:27 +0100 Subject: [PATCH 25/45] Tidy some code to use the AddResponders function --- plugins/dummy/DummyPort.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/dummy/DummyPort.cpp b/plugins/dummy/DummyPort.cpp index 31b0c68d51..73f4c2338b 100644 --- a/plugins/dummy/DummyPort.cpp +++ b/plugins/dummy/DummyPort.cpp @@ -54,7 +54,7 @@ using std::vector; /** - * A count number of responders of type T. + * @brief Add count number of responders of type T. */ template void AddResponders(map *responders, @@ -77,15 +77,11 @@ DummyPort::DummyPort(DummyDevice *parent, UID first_uid(OPEN_LIGHTING_ESTA_CODE, DummyPort::kStartAddress); ola::rdm::UIDAllocator allocator(first_uid); - for (unsigned int i = 0; i < options.number_of_dummy_responders; i++) { - auto_ptr uid(allocator.AllocateNext()); - if (!uid.get()) { - OLA_WARN << "Insufficient UIDs to create dummy RDM devices"; - break; - } - STLReplaceAndDelete(&m_responders, *uid, new DummyResponder(*uid)); - } + AddResponders( + &m_responders, &allocator, options.number_of_dummy_responders); + // This can't be done via AddResponders as we need to also tell it how many + // sub devices to add for (unsigned int i = 0; i < options.number_of_dimmers; i++) { auto_ptr uid(allocator.AllocateNext()); if (!uid.get()) { From 0c22fc2709171eeae18dee59a05e364900dcdfab Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 10 Jun 2017 17:25:54 +0100 Subject: [PATCH 26/45] Add some more debugging to RDM command parsing --- common/rdm/RDMCommand.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/common/rdm/RDMCommand.cpp b/common/rdm/RDMCommand.cpp index 3ca4765481..c150949711 100644 --- a/common/rdm/RDMCommand.cpp +++ b/common/rdm/RDMCommand.cpp @@ -325,6 +325,8 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, return NULL; } + UID source_uid(command_message.source_uid); + UID destination_uid(command_message.destination_uid); uint16_t sub_device = JoinUInt8(command_message.sub_device[0], command_message.sub_device[1]); uint16_t param_id = JoinUInt8(command_message.param_id[0], @@ -340,8 +342,8 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, switch (command_class) { case DISCOVER_COMMAND: return new RDMDiscoveryRequest( - UID(command_message.source_uid), - UID(command_message.destination_uid), + source_uid, + destination_uid, command_message.transaction_number, // transaction # command_message.port_id, // port id sub_device, @@ -351,8 +353,8 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, options); case GET_COMMAND: return new RDMGetRequest( - UID(command_message.source_uid), - UID(command_message.destination_uid), + source_uid, + destination_uid, command_message.transaction_number, // transaction # command_message.port_id, // port id sub_device, @@ -362,8 +364,8 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, options); case SET_COMMAND: return new RDMSetRequest( - UID(command_message.source_uid), - UID(command_message.destination_uid), + source_uid, + destination_uid, command_message.transaction_number, // transaction # command_message.port_id, // port id sub_device, @@ -372,7 +374,10 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, command_message.param_data_length, // data length options); default: - OLA_WARN << "Expected a RDM request command but got " << command_class; + OLA_WARN << "Expected a RDM request command but got " << ToHex(command_class) + << ", from " << source_uid << " to " << destination_uid + << ", TN " + << static_cast(command_message.transaction_number); return NULL; } } @@ -509,7 +514,9 @@ RDMResponse* RDMResponse::InflateFromData(const uint8_t *data, data + sizeof(RDMCommandHeader), command_message.param_data_length); // data length default: - OLA_WARN << "Command class isn't valid, got " << ToHex(command_class); + OLA_WARN << "Command class isn't valid, got " << ToHex(command_class) + << ", from " << source_uid << " to " << destination_uid + << ", TN " << static_cast(return_transaction_number); *status_code = RDM_INVALID_COMMAND_CLASS; return NULL; } @@ -525,7 +532,8 @@ RDMResponse* RDMResponse::CombineResponses(const RDMResponse *response1, << ", request size is " << combined_length; return NULL; } else if (response1->SourceUID() != response2->SourceUID()) { - OLA_WARN << "Source UIDs don't match"; + OLA_WARN << "Source UIDs don't match, got " << response1->SourceUID() + << " and " << response2->SourceUID(); return NULL; } @@ -561,8 +569,9 @@ RDMResponse* RDMResponse::CombineResponses(const RDMResponse *response1, combined_data, combined_length); } else { - OLA_WARN << "Expected a RDM request command but got " - << ToHex(response1->CommandClass()); + OLA_WARN << "Expected a pair of RDM response commands but got " + << ToHex(response1->CommandClass()) << " and " + << ToHex(response2->CommandClass()); } delete[] combined_data; return response; From 28b88c0e869b5a3af4bf2abda6baa92013db6577 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 16 Jun 2017 16:52:39 +0100 Subject: [PATCH 27/45] Clarify LumenRadio device name --- plugins/usbpro/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/usbpro/README.md b/plugins/usbpro/README.md index d3a092fb51..6d520643c1 100644 --- a/plugins/usbpro/README.md +++ b/plugins/usbpro/README.md @@ -10,7 +10,7 @@ includes: * DMXter4, DMXter4A & mini DMXter * Enttec DMX USB Pro & USB Pro Mk II * Robe Universe Interface -* Lumenradio +* LumenRadio CRMX Nova TX USB See https://wiki.openlighting.org/index.php/USB_Protocol_Extensions for more info. From fdd5019cacf19206980dd827281f19bce8b1b0e3 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 23 Jun 2017 19:02:12 +0100 Subject: [PATCH 28/45] Fix the order of the GDS pids --- data/rdm/manufacturer_pids.proto | 182 +++++++++++++++---------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index f2450e2663..5c5719028a 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -402,6 +402,97 @@ manufacturer { set_sub_device_range: ROOT_DEVICE } } +manufacturer { + manufacturer_id: 13364 + manufacturer_name: "Global Design Solutions, Ltd." + pid { + name: "SERIAL_NUMBER" + value: 0xffdf + get_request { + } + get_response { + field { + type: UINT32 + name: "serial_number" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } + pid { + name: "LED_DRIVE_CURRENT" + value: 0x8020 + get_request { + field { + type: UINT8 + name: "channel" + label { + value: 0xff + label: "All" + } + range { + min: 1 + max: 4 + } + } + } + get_response { + field { + type: UINT8 + name: "channel" + label { + value: 0x00 + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + set_request { + field { + type: UINT8 + name: "channel" + label { + value: 0xff + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + set_response { + field { + type: UINT8 + name: "channel" + label { + value: 0x00 + label: "All" + } + range { + min: 1 + max: 4 + } + } + field { + type: UINT8 + name: "value" + } + } + set_sub_device_range: ROOT_OR_ALL_SUBDEVICE + } +} manufacturer { manufacturer_id: 16761 manufacturer_name: "AYRTON" @@ -8901,95 +8992,4 @@ manufacturer { set_sub_device_range: ROOT_DEVICE } } -manufacturer { - manufacturer_id: 13364 - manufacturer_name: "Global Design Solutions, Ltd." - pid { - name: "SERIAL_NUMBER" - value: 0xffdf - get_request { - } - get_response { - field { - type: UINT32 - name: "serial_number" - } - } - get_sub_device_range: ROOT_OR_SUBDEVICE - } - pid { - name: "LED_DRIVE_CURRENT" - value: 0x8020 - get_request { - field { - type: UINT8 - name: "channel" - label { - value: 0xff - label: "All" - } - range { - min: 1 - max: 4 - } - } - } - get_response { - field { - type: UINT8 - name: "channel" - label { - value: 0x00 - label: "All" - } - range { - min: 1 - max: 4 - } - } - field { - type: UINT8 - name: "value" - } - } - get_sub_device_range: ROOT_OR_SUBDEVICE - set_request { - field { - type: UINT8 - name: "channel" - label { - value: 0xff - label: "All" - } - range { - min: 1 - max: 4 - } - } - field { - type: UINT8 - name: "value" - } - } - set_response { - field { - type: UINT8 - name: "channel" - label { - value: 0x00 - label: "All" - } - range { - min: 1 - max: 4 - } - } - field { - type: UINT8 - name: "value" - } - } - set_sub_device_range: ROOT_OR_ALL_SUBDEVICE - } -} version: 1458491192 From b9e73899b5888028d0b049ec1462003ab13601a5 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 23 Jun 2017 19:04:34 +0100 Subject: [PATCH 29/45] Fix the order of GDS serial number pid --- data/rdm/manufacturer_pids.proto | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index 5c5719028a..97e7783695 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -405,19 +405,6 @@ manufacturer { manufacturer { manufacturer_id: 13364 manufacturer_name: "Global Design Solutions, Ltd." - pid { - name: "SERIAL_NUMBER" - value: 0xffdf - get_request { - } - get_response { - field { - type: UINT32 - name: "serial_number" - } - } - get_sub_device_range: ROOT_OR_SUBDEVICE - } pid { name: "LED_DRIVE_CURRENT" value: 0x8020 @@ -492,6 +479,19 @@ manufacturer { } set_sub_device_range: ROOT_OR_ALL_SUBDEVICE } + pid { + name: "SERIAL_NUMBER" + value: 0xffdf + get_request { + } + get_response { + field { + type: UINT32 + name: "serial_number" + } + } + get_sub_device_range: ROOT_OR_SUBDEVICE + } } manufacturer { manufacturer_id: 16761 From c650418eb8e3e49db52e691eb68b6227965a089c Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 23 Jun 2017 20:09:23 +0100 Subject: [PATCH 30/45] Fix a lint issue --- common/rdm/RDMCommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/rdm/RDMCommand.cpp b/common/rdm/RDMCommand.cpp index c150949711..3dd0987836 100644 --- a/common/rdm/RDMCommand.cpp +++ b/common/rdm/RDMCommand.cpp @@ -374,9 +374,9 @@ RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, command_message.param_data_length, // data length options); default: - OLA_WARN << "Expected a RDM request command but got " << ToHex(command_class) - << ", from " << source_uid << " to " << destination_uid - << ", TN " + OLA_WARN << "Expected a RDM request command but got " + << ToHex(command_class) << ", from " << source_uid << " to " + << destination_uid << ", TN " << static_cast(command_message.transaction_number); return NULL; } From 8af9bbe113b0b9e4cd2515b4a4bca4a53928aafd Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 23 Jun 2017 20:15:55 +0100 Subject: [PATCH 31/45] Fix a flake8 issue --- tools/rdm/TestDefinitions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index a089746a99..92f12cfbfc 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -6782,7 +6782,8 @@ class SetOutOfRangePresetStatus(TestMixins.SetOutOfRangePresetStatusMixin, OptionalParameterTestFixture): """Set the PRESET_STATUS for max_scene + 1.""" CATEGORY = TestCategory.ERROR_CONDITIONS - REQUIRES = ['max_scene_number'] + TestMixins.SetOutOfRangePresetStatusMixin.REQUIRES + REQUIRES = (['max_scene_number'] + + TestMixins.SetOutOfRangePresetStatusMixin.REQUIRES) def PresetStatusSceneNumber(self): max_scene = self.Property('max_scene_number') From a23748638b338da059f9f0cb4fc205887ad66bdc Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 2 Jul 2017 19:51:51 +0100 Subject: [PATCH 32/45] Minor code tidy --- plugins/usbdmx/EurolitePro.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/usbdmx/EurolitePro.cpp b/plugins/usbdmx/EurolitePro.cpp index 31781ed1e5..05498d40b8 100644 --- a/plugins/usbdmx/EurolitePro.cpp +++ b/plugins/usbdmx/EurolitePro.cpp @@ -26,6 +26,7 @@ #include "libs/usb/LibUsbAdaptor.h" #include "ola/Constants.h" #include "ola/Logging.h" +#include "ola/StringUtils.h" #include "ola/util/Utils.h" #include "plugins/usbdmx/AsyncUsbSender.h" #include "plugins/usbdmx/ThreadedUsbSender.h" @@ -91,8 +92,8 @@ bool LocateInterface(LibUsbAdaptor *adaptor, const struct libusb_endpoint_descriptor *endpoint = &iface_descriptor->endpoint[k]; OLA_DEBUG << "Interface " << i << ", altsetting " << j << ", endpoint " - << static_cast(k) << ", endpoint address 0x" << std::hex - << static_cast(endpoint->bEndpointAddress); + << static_cast(k) << ", endpoint address " + << ola::strings::ToHex(endpoint->bEndpointAddress); if (endpoint->bEndpointAddress == ENDPOINT) { OLA_INFO << "Using interface " << i; *interface_number = i; From 60a948d6260eb378ec9d9610c8268767c4eb1aa1 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 19 Aug 2017 22:49:50 +0100 Subject: [PATCH 33/45] Fix some more minor PID issues from an offline version of the rdm-app --- data/rdm/manufacturer_pids.proto | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/data/rdm/manufacturer_pids.proto b/data/rdm/manufacturer_pids.proto index 97e7783695..26de5313d7 100644 --- a/data/rdm/manufacturer_pids.proto +++ b/data/rdm/manufacturer_pids.proto @@ -50,7 +50,7 @@ manufacturer { } manufacturer { manufacturer_id: 776 - manufacturer_name: "ImageCue LLC" + manufacturer_name: "ImageCue LLC " pid { name: "SERIAL_NUMBER" value: 32976 @@ -407,15 +407,11 @@ manufacturer { manufacturer_name: "Global Design Solutions, Ltd." pid { name: "LED_DRIVE_CURRENT" - value: 0x8020 + value: 32800 get_request { field { type: UINT8 name: "channel" - label { - value: 0xff - label: "All" - } range { min: 1 max: 4 @@ -426,10 +422,6 @@ manufacturer { field { type: UINT8 name: "channel" - label { - value: 0x00 - label: "All" - } range { min: 1 max: 4 @@ -446,13 +438,17 @@ manufacturer { type: UINT8 name: "channel" label { - value: 0xff + value: 255 label: "All" } range { min: 1 max: 4 } + range { + min: 255 + max: 255 + } } field { type: UINT8 @@ -464,11 +460,11 @@ manufacturer { type: UINT8 name: "channel" label { - value: 0x00 + value: 0 label: "All" } range { - min: 1 + min: 0 max: 4 } } @@ -481,7 +477,7 @@ manufacturer { } pid { name: "SERIAL_NUMBER" - value: 0xffdf + value: 65503 get_request { } get_response { @@ -8778,15 +8774,13 @@ manufacturer { field { type: UINT16 name: "dali_group_membership" - #bitset } } get_sub_device_range: ROOT_OR_SUBDEVICE set_request { field { type: UINT16 - name: "dali_short_address" - #bitset + name: "dali_group_membership" } } set_response { @@ -8992,4 +8986,4 @@ manufacturer { set_sub_device_range: ROOT_DEVICE } } -version: 1458491192 +version: 1503179153 From 231aac5cabb50326e2e8b2979a48ebfc5919f392 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:01:57 +0100 Subject: [PATCH 34/45] More RDM tests --- tools/rdm/TestDefinitions.py | 68 +++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 224fafe9db..35ac4238ea 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -1083,6 +1083,48 @@ def Test(self): self.SendSet(ROOT_DEVICE, self.pid, []) +# Sub device status report threshold +# ----------------------------------------------------------------------------- +class AllSubDevicesGetSubDeviceStatusReportThreshold( + TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get SUB_DEVICE_STATUS_REPORT_THRESHOLD to ALL_SUB_DEVICES.""" + PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' + + +# class GetSubDeviceStatusReportThreshold(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' +# TODO(peter): Test get + + +class GetSubDeviceStatusReportThresholdWithData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET SUB_DEVICE_STATUS_REPORT_THRESHOLD with data.""" + PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' + + +# class SetSubDeviceStatusReportThreshold(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' +# TODO(peter): Test set + + +class SetSubDeviceStatusReportThresholdWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set SUB_DEVICE_STATUS_REPORT_THRESHOLD command with no data.""" + PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' + + +class SetSubDeviceStatusReportThresholdWithExtraData( + TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET SUB_DEVICE_STATUS_REPORT_THRESHOLD command with extra data.""" + PID = 'SUB_DEVICE_STATUS_REPORT_THRESHOLD' + + # Parameter Description # ----------------------------------------------------------------------------- class GetParameterDescription(ParamDescriptionTestFixture): @@ -1541,6 +1583,7 @@ def OldValue(self): class SetEmptyDeviceLabel(TestMixins.SetLabelMixin, OptionalParameterTestFixture): """SET the device label with no data.""" + # AKA SetDeviceLabelWithNoData CATEGORY = TestCategory.PRODUCT_INFORMATION PID = 'DEVICE_LABEL' REQUIRES = ['device_label'] @@ -1553,6 +1596,7 @@ def OldValue(self): class SetOversizedDeviceLabel(TestMixins.SetOversizedLabelMixin, OptionalParameterTestFixture): """SET the device label with more than 32 bytes of data.""" + # AKA SetDeviceLabelWithExtraData REQUIRES = ['device_label'] PID = 'DEVICE_LABEL' @@ -7260,16 +7304,24 @@ class GetIPv4DefaultRouteWithData(TestMixins.GetWithDataMixin, # TODO(Peter): Need to restrict these somehow so we don't saw off the branch -# class SetIPv4DefaultRoute(TestMixins.UnsupportedSetMixin, +# class SetIPv4DefaultRoute(TestMixins., # OptionalParameterTestFixture): -# """Attempt to SET the IPv4 default route with no data.""" -# PID = 'IPV4_DEFAULT_ROUTE' -# -# -# class SetIPv4DefaultRouteWithData(TestMixins.UnsupportedSetWithDataMixin, -# OptionalParameterTestFixture): -# """SET the IPv4 default route with data.""" +# CATEGORY = TestCategory. # PID = 'IPV4_DEFAULT_ROUTE' +# TODO(peter): Test set + + +class SetIPv4DefaultRouteWithNoData(TestMixins.SetWithNoDataMixin, + OptionalParameterTestFixture): + """Set IPV4_DEFAULT_ROUTE command with no data.""" + PID = 'IPV4_DEFAULT_ROUTE' + + +class SetIPv4DefaultRouteWithExtraData(TestMixins.SetWithDataMixin, + OptionalParameterTestFixture): + """Send a SET IPV4_DEFAULT_ROUTE command with extra data.""" + PID = 'IPV4_DEFAULT_ROUTE' + DATA = 'foobarbaz' class AllSubDevicesGetIPv4DefaultRoute(TestMixins.AllSubDevicesGetMixin, From 127053246f438a6bc0ee5c7201c1739b1b18dabd Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:05:15 +0100 Subject: [PATCH 35/45] More RDM tests --- tools/rdm/TestDefinitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 35ac4238ea..51d6179f4f 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -4351,7 +4351,7 @@ class GetFactoryDefaultsWithData(TestMixins.GetWithDataMixin, PID = 'FACTORY_DEFAULTS' -class ResetFactoryDefaults(OptionalParameterTestFixture): +class SetFactoryDefaults(OptionalParameterTestFixture): """Reset to factory defaults.""" CATEGORY = TestCategory.PRODUCT_INFORMATION PID = 'FACTORY_DEFAULTS' From 1114d6700aa2aee97d89e95f5a2d737eafbe2e61 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:47:28 +0100 Subject: [PATCH 36/45] Add a positive test for IP address to int conversion --- common/network/IPV4AddressTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/network/IPV4AddressTest.cpp b/common/network/IPV4AddressTest.cpp index b900ee1737..044552db13 100644 --- a/common/network/IPV4AddressTest.cpp +++ b/common/network/IPV4AddressTest.cpp @@ -75,6 +75,7 @@ void IPAddressTest::testIPV4Address() { int ip_as_int = address1.AsInt(); OLA_ASSERT_NE(wildcard_address, address1); OLA_ASSERT_NE(HostToNetwork(0xc0a811), ip_as_int); + OLA_ASSERT_EQ(HostToNetwork(0xc0a80101), static_cast(ip_as_int)); // Test Get() uint8_t addr[IPV4Address::LENGTH]; From 526567599080f02a478eeb4127ce777202ea1e21 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:49:28 +0100 Subject: [PATCH 37/45] Improve output from logic sniffer --- tools/logic/logic-rdm-sniffer.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/logic/logic-rdm-sniffer.cpp b/tools/logic/logic-rdm-sniffer.cpp index 2def518656..2b8eb41fd1 100644 --- a/tools/logic/logic-rdm-sniffer.cpp +++ b/tools/logic/logic-rdm-sniffer.cpp @@ -267,8 +267,9 @@ void LogicReader::ProcessData(U8 *data, uint32_t data_length) { void LogicReader::DisplayDMXFrame(const uint8_t *data, unsigned int length) { - if (!FLAGS_display_dmx) + if (!FLAGS_display_dmx) { return; + } cout << "DMX " << std::dec; cout << length << ":" << std::hex; @@ -283,6 +284,8 @@ void LogicReader::DisplayRDMFrame(const uint8_t *data, unsigned int length) { } command->Print(&m_command_printer, !FLAGS_full_rdm, true); } else { + cout << "RDM " << std::dec; + cout << length << ":" << std::hex; DisplayRawData(data, length); } } @@ -290,8 +293,9 @@ void LogicReader::DisplayRDMFrame(const uint8_t *data, unsigned int length) { void LogicReader::DisplayAlternateFrame(const uint8_t *data, unsigned int length) { - if (!FLAGS_display_asc || length == 0) + if (!FLAGS_display_asc || length == 0) { return; + } unsigned int slot_count = length - 1; cout << "SC " << ToHex(static_cast(data[0])) @@ -305,7 +309,8 @@ void LogicReader::DisplayAlternateFrame(const uint8_t *data, */ void LogicReader::DisplayRawData(const uint8_t *data, unsigned int length) { for (unsigned int i = 0; i < length; i++) { - cout << std::hex << std::setw(2) << static_cast(data[i]) << " "; + cout << std::hex << std::setw(2) << std::setfill('0') + << static_cast(data[i]) << " "; } cout << endl; } From 4e93de14fd2670b4d20ba0d4a17f2577c45e3e29 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:51:06 +0100 Subject: [PATCH 38/45] Yet more RDM tests --- tools/rdm/TestDefinitions.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 51d6179f4f..2c278b2d4b 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7434,12 +7434,12 @@ class GetIPv4ZeroconfModeWithExtraData(TestMixins.GetWithDataMixin, # TODO(peter): Test set -# class SetZeroIPv4ZeroconfMode(TestMixins., -# OptionalParameterTestFixture): -# """SET IPV4_ZEROCONF_MODE to interface identifier 0.""" -# CATEGORY = TestCategory.ERROR_CONDITIONS -# PID = 'IPV4_ZEROCONF_MODE' -# TODO(peter): Test set zero +class SetZeroIPv4ZeroconfMode(TestMixins.SetZeroMixin, + OptionalParameterTestFixture): + """SET IPV4_ZEROCONF_MODE to interface identifier 0.""" + CATEGORY = TestCategory.ERROR_CONDITIONS + PID = 'IPV4_ZEROCONF_MODE' + DATA = struct.pack('!IB', 0x00000000, 0x00) class SetIPv4ZeroconfModeWithNoData(TestMixins.SetWithNoDataMixin, @@ -7544,12 +7544,13 @@ class GetIPv4StaticAddressWithExtraData(TestMixins.GetWithDataMixin, # TODO(peter): Test set -# class SetZeroIPv4StaticAddress(TestMixins., -# OptionalParameterTestFixture): -# """SET IPV4_STATIC_ADDRESS to interface identifier 0.""" -# CATEGORY = TestCategory.ERROR_CONDITIONS -# PID = 'IPV4_STATIC_ADDRESS' -# TODO(peter): Test set zero +class SetZeroIPv4StaticAddress(TestMixins.SetZeroMixin, + OptionalParameterTestFixture): + """SET IPV4_STATIC_ADDRESS to interface identifier 0.""" + CATEGORY = TestCategory.ERROR_CONDITIONS + PID = 'IPV4_STATIC_ADDRESS' + # 192.168.0.1 + DATA = struct.pack('!IIB', 0x00000000, 0xc0a80001, 24) class SetIPv4StaticAddressWithNoData(TestMixins.SetWithNoDataMixin, From e3724ff547ee837bde4334df29c37b4c832eebbb Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 09:52:45 +0100 Subject: [PATCH 39/45] Fix the RDM test code --- tools/rdm/TestDefinitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 2c278b2d4b..6b346e0627 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7436,7 +7436,7 @@ class GetIPv4ZeroconfModeWithExtraData(TestMixins.GetWithDataMixin, class SetZeroIPv4ZeroconfMode(TestMixins.SetZeroMixin, OptionalParameterTestFixture): - """SET IPV4_ZEROCONF_MODE to interface identifier 0.""" + """SET IPV4_ZEROCONF_MODE to interface identifier 0.""" CATEGORY = TestCategory.ERROR_CONDITIONS PID = 'IPV4_ZEROCONF_MODE' DATA = struct.pack('!IB', 0x00000000, 0x00) From f5decfb38dd889bad436ca3001af8a3f6b63458b Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 20 Aug 2017 10:19:08 +0100 Subject: [PATCH 40/45] Status message RDM tests --- tools/rdm/TestDefinitions.py | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 6b346e0627..8c5057b69d 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -1016,6 +1016,47 @@ def VerifyResult(self, response, fields): self._sub_device_footprints[self._current_index] = fields['dmx_footprint'] +# Status Messages +# ----------------------------------------------------------------------------- +# TODO(Peter): These might all upset queued messages? +class AllSubDevicesGetStatusMessages(TestMixins.AllSubDevicesGetMixin, + OptionalParameterTestFixture): + """Send a get STATUS_MESSAGES to ALL_SUB_DEVICES.""" + PID = 'STATUS_MESSAGES' + DATA = [0x00] + + +# class GetStatusMessages(TestMixins., +# OptionalParameterTestFixture): +# CATEGORY = TestCategory. +# PID = 'STATUS_MESSAGES' +# TODO(peter): Test get, use STATUS_NONE (0x00) + + +class GetStatusMessagesWithNoData(TestMixins.GetWithNoDataMixin, + OptionalParameterTestFixture): + """GET STATUS_MESSAGES with no argument given.""" + PID = 'STATUS_MESSAGES' + + +class GetStatusMessagesWithExtraData(TestMixins.GetWithDataMixin, + OptionalParameterTestFixture): + """GET STATUS_MESSAGES with more than 1 byte of data.""" + PID = 'STATUS_MESSAGES' + + +class SetStatusMessages(TestMixins.UnsupportedSetMixin, + OptionalParameterTestFixture): + """Attempt to SET STATUS_MESSAGES.""" + PID = 'STATUS_MESSAGES' + + +class SetStatusMessagesWithData(TestMixins.UnsupportedSetWithDataMixin, + OptionalParameterTestFixture): + """Attempt to SET STATUS_MESSAGES with data.""" + PID = 'STATUS_MESSAGES' + + # Status ID Description # ----------------------------------------------------------------------------- class AllSubDevicesGetStatusIdDescription(TestMixins.AllSubDevicesGetMixin, From 83f623570e5a95d4dbcb81f74dfa2d1c4dcb208b Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Mon, 21 Aug 2017 00:16:41 +0100 Subject: [PATCH 41/45] Add yet another test --- tools/rdm/TestDefinitions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 8c5057b69d..c3f9d10377 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -7839,6 +7839,13 @@ class SetInterfaceHardwareAddressType1(TestMixins.UnsupportedSetMixin, PID = 'INTERFACE_HARDWARE_ADDRESS_TYPE1' +class SetInterfaceHardwareAddressType1WithData( + TestMixins.UnsupportedSetWithDataMixin, + OptionalParameterTestFixture): + """Attempt to SET INTERFACE_HARDWARE_ADDRESS_TYPE1 with data.""" + PID = 'INTERFACE_HARDWARE_ADDRESS_TYPE1' + + # Cross check the control fields with various other properties # ----------------------------------------------------------------------------- class SubDeviceControlField(TestFixture): From d35191f3416125b6847c6c9d498c4d62baf0af17 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 26 Aug 2017 15:58:26 +0100 Subject: [PATCH 42/45] Raise the log level of some messages --- tools/logic/logic-rdm-sniffer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/logic/logic-rdm-sniffer.cpp b/tools/logic/logic-rdm-sniffer.cpp index 2b8eb41fd1..e57711c5d1 100644 --- a/tools/logic/logic-rdm-sniffer.cpp +++ b/tools/logic/logic-rdm-sniffer.cpp @@ -81,6 +81,7 @@ using ola::NewSingleCallback; DEFINE_default_bool(display_asc, false, "Display non-RDM alternate start code frames."); DEFINE_s_default_bool(full_rdm, r, false, "Unpack RDM parameter data."); +// TODO(Peter): Implement this! DEFINE_s_default_bool(timestamp, t, false, "Include timestamps."); DEFINE_s_default_bool(display_dmx, d, false, "Display DMX Frames. Defaults to false."); @@ -172,7 +173,7 @@ void LogicReader::DeviceConnected(U64 device, GenericInterface *interface) { } void LogicReader::DeviceDisconnected(U64 device) { - OLA_INFO << "Device " << device << " disconnected"; + OLA_FATAL << "Device " << device << " disconnected"; MutexLocker lock(&m_mu); if (device != m_device_id) { @@ -347,7 +348,7 @@ void OnReadData(U64 device_id, U8 *data, uint32_t data_length, } void OnError(U64 device_id, void *user_data) { - OLA_INFO << "A device reported an Error."; + OLA_WARN << "A device reported an Error."; (void) device_id; (void) user_data; } From a7154dee8e92c1f6ff7e1270357ef691ff08e1a3 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 26 Aug 2017 16:10:50 +0100 Subject: [PATCH 43/45] Minor tidying --- tools/logic/logic-rdm-sniffer.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tools/logic/logic-rdm-sniffer.cpp b/tools/logic/logic-rdm-sniffer.cpp index e57711c5d1..d471c1503f 100644 --- a/tools/logic/logic-rdm-sniffer.cpp +++ b/tools/logic/logic-rdm-sniffer.cpp @@ -125,8 +125,8 @@ class LogicReader { private: const unsigned int m_sample_rate; - U64 m_device_id; // GUARDED_BY(mu_); - LogicInterface *m_logic; // GUARDED_BY(mu_); + U64 m_device_id; // GUARDED_BY(m_mu); + LogicInterface *m_logic; // GUARDED_BY(m_mu); mutable Mutex m_mu; SelectServer *m_ss; DMXSignalProcessor m_signal_processor; @@ -183,8 +183,6 @@ void LogicReader::DeviceDisconnected(U64 device) { m_logic = NULL; m_ss->Terminate(); - - // } /** @@ -198,6 +196,8 @@ void LogicReader::DataReceived(U64 device, U8 *data, uint32_t data_length) { { MutexLocker lock(&m_mu); if (device != m_device_id) { + OLA_WARN << "Received data from another device, expecting " + << m_device_id << " got " << device; DevicesManagerInterface::DeleteU8ArrayPtr(data); return; } @@ -233,9 +233,7 @@ void LogicReader::FrameReceived(const uint8_t *data, unsigned int length) { } } -/** - * - */ + void LogicReader::Stop() { MutexLocker lock(&m_mu); if (m_logic) { @@ -319,8 +317,9 @@ void LogicReader::DisplayRawData(const uint8_t *data, unsigned int length) { // SaleaeDeviceApi callbacks void OnConnect(U64 device_id, GenericInterface* device_interface, void* user_data) { - if (!user_data) + if (!user_data) { return; + } LogicReader *reader = (LogicReader*) user_data; // NOLINT(readability/casting) @@ -328,8 +327,9 @@ void OnConnect(U64 device_id, GenericInterface* device_interface, } void OnDisconnect(U64 device_id, void *user_data) { - if (!user_data) + if (!user_data) { return; + } LogicReader *reader = (LogicReader*) user_data; // NOLINT(readability/casting) @@ -348,8 +348,7 @@ void OnReadData(U64 device_id, U8 *data, uint32_t data_length, } void OnError(U64 device_id, void *user_data) { - OLA_WARN << "A device reported an Error."; - (void) device_id; + OLA_WARN << "Device " << device_id << " reported an error."; (void) user_data; } From c68485d2a431a335e8ccb9b844de259a9785df78 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 26 Aug 2017 16:13:25 +0100 Subject: [PATCH 44/45] More code tidying --- tools/logic/logic-rdm-sniffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/logic/logic-rdm-sniffer.cpp b/tools/logic/logic-rdm-sniffer.cpp index d471c1503f..dff3282ba9 100644 --- a/tools/logic/logic-rdm-sniffer.cpp +++ b/tools/logic/logic-rdm-sniffer.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -347,9 +348,8 @@ void OnReadData(U64 device_id, U8 *data, uint32_t data_length, reader->DataReceived(device_id, data, data_length); } -void OnError(U64 device_id, void *user_data) { +void OnError(U64 device_id, OLA_UNUSED void *user_data) { OLA_WARN << "Device " << device_id << " reported an error."; - (void) user_data; } void DisplayReminder(LogicReader *reader) { From dd3679c21df7bdd92a5e36c7c5a8d3878937951c Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 22 Sep 2017 10:49:17 +0100 Subject: [PATCH 45/45] Tidy some categories --- tools/rdm/TestDefinitions.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/rdm/TestDefinitions.py b/tools/rdm/TestDefinitions.py index 4af504505a..4ac95abb33 100644 --- a/tools/rdm/TestDefinitions.py +++ b/tools/rdm/TestDefinitions.py @@ -198,6 +198,7 @@ def Test(self): class MuteAllDevices(ResponderTestFixture): """Mute all devices, so we can perform DUB tests""" PID = 'DISC_MUTE' + CATEGORY = TestCategory.NETWORK_MANAGEMENT REQUIRES = ['mute_supported'] # This is a fake property used to ensure this tests runs before the DUB tests. PROVIDES = ['global_mute'] @@ -269,7 +270,6 @@ class DUBSingleLowerUID(TestMixins.DiscoveryMixin, ResponderTestFixture): """DUB from - 1 to - 1.""" CATEGORY = TestCategory.NETWORK_MANAGEMENT - CATEGORY = TestCategory.NETWORK_MANAGEMENT REQUIRES = ['dub_supported'] + TestMixins.DiscoveryMixin.REQUIRES def LowerBound(self): @@ -286,7 +286,6 @@ class DUBSingleUpperUID(TestMixins.DiscoveryMixin, ResponderTestFixture): """DUB from + 1 to + 1.""" CATEGORY = TestCategory.NETWORK_MANAGEMENT - CATEGORY = TestCategory.NETWORK_MANAGEMENT REQUIRES = ['dub_supported'] + TestMixins.DiscoveryMixin.REQUIRES def LowerBound(self):