Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/openlightingproject/ola i…
Browse files Browse the repository at this point in the history
…nto e1.33-controller
  • Loading branch information
peternewman committed Apr 11, 2024
2 parents 49d4e2c + b93b8e0 commit af117de
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 50 deletions.
8 changes: 5 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ COVERAGE_OUTPUTS = --txt coverage/coverage.txt \
--cobertura coverage/coverage.cobertura.xml \
--html-details coverage/details.html/coverage.details.html \
--coveralls coverage/coverage.coveralls.json
COVERAGE_GCOV_EXE=--gcov-executable /usr/bin/gcov
COVERAGE_FILTERS=-e '.*Test\.cpp$$' \
# See https://gcovr.com/en/stable/guide/gcov_parser.html#negative-hit-counts
COVERAGE_FLAGS = --gcov-ignore-parse-errors=negative_hits.warn_once_per_file
COVERAGE_GCOV_EXE = --gcov-executable /usr/bin/gcov
COVERAGE_FILTERS = -e '.*Test\.cpp$$' \
-e '.*\.pb\.cc$$' \
-e '.*\.pb\.cpp$$' \
-e '.*\.pb\.h$$' \
Expand All @@ -288,7 +290,7 @@ if !BUILD_GCOV
else
if FOUND_GCOVR
mkdir -p coverage/details.html/
gcovr --print-summary $(COVERAGE_OUTPUTS) $(COVERAGE_GCOV_EXE) --root . $(COVERAGE_FILTERS)
gcovr $(COVERAGE_FLAGS) --print-summary $(COVERAGE_OUTPUTS) $(COVERAGE_GCOV_EXE) --root . $(COVERAGE_FILTERS)
else
$(error gcovr not found. Install gcovr (e.g. via pip for the latest version) and re-run configure.)
endif
Expand Down
2 changes: 1 addition & 1 deletion common/rdm/QueueingRDMController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* QueueingRDMController.cpp
* The Jese DMX TRI device.
* An RDM Controller that sends a single message at a time.
* Copyright (C) 2010 Simon Newton
*/

Expand Down
2 changes: 1 addition & 1 deletion common/rdm/QueueingRDMControllerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* QueueingRDMControllerTest.cpp
* Test fixture for the UID classes
* Test fixture for the QueueingRDMController
* Copyright (C) 2005 Simon Newton
*/

Expand Down
2 changes: 1 addition & 1 deletion common/rdm/VariableFieldSizeCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ VariableFieldSizeCalculator::calculator_state
return data_size > m_fixed_size_sum ? TOO_LARGE : FIXED_SIZE;

// we know there is only one, now we need to work out the number of
// repeatitions or length if it's a string
// repetitions or length if it's a string
unsigned int bytes_remaining = data_size - m_fixed_size_sum;
if (variable_string_field_count) {
// variable string
Expand Down
2 changes: 1 addition & 1 deletion include/ola/rdm/QueueingRDMController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* QueueingRDMController.h
* A RDM Controller that sends a single message at a time.
* An RDM Controller that sends a single message at a time.
* Copyright (C) 2010 Simon Newton
*/

Expand Down
2 changes: 0 additions & 2 deletions libs/acn/RDMInflator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class RDMInflator: public BaseInflator {
void SetRDMHandler(RDMMessageHandler *handler);
void SetGenericRDMHandler(GenericRDMMessageHandler *handler);

static const unsigned int VECTOR_RDMNET_DATA = 0xcc;

protected:
bool DecodeHeader(HeaderSet *headers,
const uint8_t *data,
Expand Down
4 changes: 3 additions & 1 deletion libs/acn/RPTInflatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(RPTInflatorTest);
*/
void RPTInflatorTest::testDecodeHeader() {
RPTHeader::rpt_pdu_header header;
memset(&header, 0, sizeof(header));
// Need to cast the header before we memset as it's got a constructor to
// ensure the reserved value is set to zero by default
memset(reinterpret_cast<uint8_t*>(&header), 0, sizeof(header));
RPTInflator inflator;
HeaderSet header_set, header_set2;
unsigned int bytes_used;
Expand Down
2 changes: 1 addition & 1 deletion plugins/spi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pin. The number of ports will be 2 ^ (# of pins).
If the software backend is used, this defines the number of ports which will
be created.

`<device>-sync-ports = <int>`
`<device>-sync-port = <int>`
Controls which port triggers a flush (write) of the SPI data. If set to -1
the SPI data is written when any port changes. This can result in a lot of
data writes (slow) and partial frames. If set to -2, the last port is used.
Expand Down
4 changes: 2 additions & 2 deletions plugins/usbpro/DmxterWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const uint8_t DmxterWidgetImpl::TOD_LABEL = 0x82;
const uint8_t DmxterWidgetImpl::DISCOVERY_BRANCH_LABEL = 0x83;
const uint8_t DmxterWidgetImpl::FULL_DISCOVERY_LABEL = 0x84;
const uint8_t DmxterWidgetImpl::INCREMENTAL_DISCOVERY_LABEL = 0x85;
const uint8_t DmxterWidgetImpl::SHUTDOWN_LABAEL = 0xf0;
const uint8_t DmxterWidgetImpl::SHUTDOWN_LABEL = 0xf0;


/*
Expand Down Expand Up @@ -195,7 +195,7 @@ void DmxterWidgetImpl::HandleMessage(uint8_t label,
case RDM_BCAST_REQUEST_LABEL:
HandleBroadcastRDMResponse(data, length);
break;
case SHUTDOWN_LABAEL:
case SHUTDOWN_LABEL:
HandleShutdown(data, length);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion plugins/usbpro/DmxterWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DmxterWidgetImpl: public BaseUsbProWidget,
static const uint8_t DISCOVERY_BRANCH_LABEL;
static const uint8_t FULL_DISCOVERY_LABEL;
static const uint8_t INCREMENTAL_DISCOVERY_LABEL;
static const uint8_t SHUTDOWN_LABAEL;
static const uint8_t SHUTDOWN_LABEL;

typedef enum {
RC_CHECKSUM_ERROR = 1,
Expand Down
5 changes: 4 additions & 1 deletion scripts/spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ SPELLINGBLACKLIST=$(cat <<-BLACKLIST
-wholename "./olad/www/new/js/app.min.js" -or \
-wholename "./olad/www/new/js/app.min.js.map" -or \
-wholename "./olad/www/new/libs/angular/js/angular.min.js" -or \
-wholename "./olad/www/new/libs/bootstrap/js/bootstrap.min.js" -or \
-wholename "./olad/www/new/libs/jquery/js/jquery.min.js" -or \
-wholename "./olad/www/new/libs/marked/js/marked.min.js" -or \
-wholename "./olad/www/ola.js" -or \
-wholename "./plugins/artnet/messages/ArtNetConfigMessages.pb.*" -or \
-wholename "./tools/ola_trigger/config.tab.*" -or \
-wholename "./tools/ola_trigger/lex.yy.cpp"
-wholename "./tools/ola_trigger/lex.yy.cpp" -or \
-wholename "./tools/rdm/static/jquery-1.7.2.min.js"
BLACKLIST
)

Expand Down
48 changes: 27 additions & 21 deletions tools/rdm/TestDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8059,7 +8059,7 @@ class SetEndpointModeWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET ENDPOINT_MODE command with extra data."""
PID = 'ENDPOINT_MODE'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetEndpointLabel(TestMixins.AllSubDevicesGetMixin,
Expand Down Expand Up @@ -8178,7 +8178,7 @@ class SetEndpointTimingWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET ENDPOINT_TIMING command with extra data."""
PID = 'ENDPOINT_TIMING'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetEndpointTimingDescription(
Expand Down Expand Up @@ -8438,67 +8438,67 @@ class SetEndpointToUniverseWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET ENDPOINT_TO_UNIVERSE command with extra data."""
PID = 'ENDPOINT_TO_UNIVERSE'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetRdmTrafficEnable(TestMixins.AllSubDevicesGetMixin,
class AllSubDevicesGetRDMTrafficEnable(TestMixins.AllSubDevicesGetMixin,
OptionalParameterTestFixture):
"""Send a get RDM_TRAFFIC_ENABLE to ALL_SUB_DEVICES."""
PID = 'RDM_TRAFFIC_ENABLE'
DATA = [0x0001]


# class GetRdmTrafficEnable(TestMixins.,
# class GetRDMTrafficEnable(TestMixins.,
# OptionalParameterTestFixture):
# CATEGORY = TestCategory.
# PID = 'RDM_TRAFFIC_ENABLE'
# TODO(peter): Test get


class GetZeroRdmTrafficEnable(TestMixins.GetZeroUInt16Mixin,
class GetZeroRDMTrafficEnable(TestMixins.GetZeroUInt16Mixin,
OptionalParameterTestFixture):
"""GET RDM_TRAFFIC_ENABLE for endpoint id 0."""
PID = 'RDM_TRAFFIC_ENABLE'
OVERRIDE_NACKS = [RDMNack.NR_ENDPOINT_NUMBER_INVALID]


class GetRdmTrafficEnableWithNoData(TestMixins.GetWithNoDataMixin,
class GetRDMTrafficEnableWithNoData(TestMixins.GetWithNoDataMixin,
OptionalParameterTestFixture):
"""GET RDM_TRAFFIC_ENABLE with no argument given."""
PID = 'RDM_TRAFFIC_ENABLE'


class GetRdmTrafficEnableWithExtraData(TestMixins.GetWithDataMixin,
class GetRDMTrafficEnableWithExtraData(TestMixins.GetWithDataMixin,
OptionalParameterTestFixture):
"""GET RDM_TRAFFIC_ENABLE with more than 2 bytes of data."""
PID = 'RDM_TRAFFIC_ENABLE'


# class SetRdmTrafficEnable(TestMixins.,
# class SetRDMTrafficEnable(TestMixins.,
# OptionalParameterTestFixture):
# CATEGORY = TestCategory.
# PID = 'RDM_TRAFFIC_ENABLE'
# TODO(peter): Test set


# class SetZeroRdmTrafficEnable(TestMixins.SetZero,
# class SetZeroRDMTrafficEnable(TestMixins.SetZero,
# OptionalParameterTestFixture):
# """SET RDM_TRAFFIC_ENABLE for endpoint id 0."""
# PID = 'RDM_TRAFFIC_ENABLE'
# TODO(peter): Test set zero


class SetRdmTrafficEnableWithNoData(TestMixins.SetWithNoDataMixin,
class SetRDMTrafficEnableWithNoData(TestMixins.SetWithNoDataMixin,
OptionalParameterTestFixture):
"""Set RDM_TRAFFIC_ENABLE command with no data."""
PID = 'RDM_TRAFFIC_ENABLE'


class SetRdmTrafficEnableWithExtraData(TestMixins.SetWithDataMixin,
class SetRDMTrafficEnableWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET RDM_TRAFFIC_ENABLE command with extra data."""
PID = 'RDM_TRAFFIC_ENABLE'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetDiscoveryState(TestMixins.AllSubDevicesGetMixin,
Expand Down Expand Up @@ -8558,7 +8558,7 @@ class SetDiscoveryStateWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET DISCOVERY_STATE command with extra data."""
PID = 'DISCOVERY_STATE'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetBackgroundDiscovery(TestMixins.AllSubDevicesGetMixin,
Expand Down Expand Up @@ -8618,7 +8618,7 @@ class SetBackgroundDiscoveryWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET BACKGROUND_DISCOVERY command with extra data."""
PID = 'BACKGROUND_DISCOVERY'
DATA = 'foobar'
DATA = b'foobar'


class AllSubDevicesGetBackgroundQueuedStatusPolicy(
Expand Down Expand Up @@ -8654,22 +8654,26 @@ class SetBackgroundQueuedStatusPolicyWithNoData(TestMixins.SetWithNoDataMixin,
PID = 'BACKGROUND_QUEUED_STATUS_POLICY'


class SetBackgroundQueuedStatusPolicyWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
class SetBackgroundQueuedStatusPolicyWithExtraData(
TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET BACKGROUND_QUEUED_STATUS_POLICY command with extra data."""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY'


class AllSubDevicesGetBackgroundQueuedStatusPolicyDescription(
TestMixins.AllSubDevicesGetMixin,
OptionalParameterTestFixture):
"""Send a get BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION to ALL_SUB_DEVICES."""
"""Send a get BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION to
ALL_SUB_DEVICES.
"""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'
DATA = [0x00]


# class GetBackgroundQueuedStatusPolicyDescription(TestMixins.,
# OptionalParameterTestFixture):
# class GetBackgroundQueuedStatusPolicyDescription(
# TestMixins.,
# OptionalParameterTestFixture):
# CATEGORY = TestCategory.
# PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'
# TODO(peter): Test get
Expand All @@ -8685,7 +8689,9 @@ class GetBackgroundQueuedStatusPolicyDescriptionWithNoData(
class GetBackgroundQueuedStatusPolicyDescriptionWithExtraData(
TestMixins.GetWithDataMixin,
OptionalParameterTestFixture):
"""GET BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION with more than 1 byte of data."""
"""GET BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION with more than 1 byte of
data.
"""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'


Expand Down
34 changes: 20 additions & 14 deletions tools/rdm/list_rdm_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def AllSubDevicesGet(names, pid, pid_test_base_name, get_size):
(pid.name))
print(' PID = \'%s\'' % (pid.name))
if get_size > 0:
print(' #DATA = [] # TODO(%s): Specify some suitable data, %d byte%s' %
print(' # DATA = [] # TODO(%s): Specify some suitable data, %d byte%s' %
(getpass.getuser(), get_size, 's' if get_size > 1 else ''))
print('')
print('')
Expand Down Expand Up @@ -153,15 +153,18 @@ def GetWithExtraData(names, pid, pid_test_base_name, get_size):
print(' PID = \'%s\'' % (pid.name))
dummy_data = GenerateDummyData(get_size)
if dummy_data is None:
print((" #DATA = 'foo' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (getpass.getuser(), get_size))
print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
"enough.") % (getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
elif dummy_data != 'foo':
# Doesn't match default, explicitly set value
print((" DATA = '%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), get_size))
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough.") % (dummy_data, getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
else:
print((" #DATA = '%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), get_size))
print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough.") % (dummy_data, getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
print('')
print('')

Expand Down Expand Up @@ -276,15 +279,18 @@ def SetWithExtraData(names, pid, pid_test_base_name, set_size):
print(' PID = \'%s\'' % (pid.name))
dummy_data = GenerateDummyData(set_size)
if dummy_data is None:
print((" #DATA = 'foo' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (getpass.getuser(), set_size))
print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
"enough.") % (getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
elif dummy_data != 'foo':
# Doesn't match default, explicitly set value
print((" DATA = '%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), set_size))
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough.") % (dummy_data, getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
else:
print((" #DATA = '%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), set_size))
print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough.") % (dummy_data, getpass.getuser()))
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
print('')
print('')

Expand Down Expand Up @@ -353,7 +359,7 @@ def main():
(pid.GetRequest(PidStore.RDM_GET).HasAtoms())):
for atom in pid.GetRequest(PidStore.RDM_GET).GetAtoms():
get_size += atom.size
#TODO(Peter): Should we just print this total all the time?
# TODO(Peter): Should we just print this total all the time?
if get_size != pid.GetRequest(PidStore.RDM_GET).GetAtoms()[0].size:
print('# Get requires %d bytes' % (get_size))

Expand Down

0 comments on commit af117de

Please sign in to comment.