Skip to content

Commit d1433a1

Browse files
authored
Merge pull request #1763 from peternewman/master-resync
Master resync
2 parents 31bd61c + 2058e5c commit d1433a1

30 files changed

+358
-140
lines changed

.github/workflows/annotation.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- uses: actions/checkout@master
99
- uses: actions/setup-python@v2
1010
with:
11-
python-version: 2.7
11+
python-version: '2.7'
1212
- name: Flake8 with annotations - Python 2
1313
# Using the flake8 options in the .flake8 file
1414
uses: TrueBrain/actions-flake8@main
@@ -18,9 +18,7 @@ jobs:
1818
- uses: actions/checkout@master
1919
- uses: actions/setup-python@v2
2020
with:
21-
python-version: 3.9
21+
python-version: '3.10'
2222
- name: Flake8 with annotations - Python 3
2323
# Using the flake8 options in the .flake8 file
2424
uses: TrueBrain/actions-flake8@main
25-
with:
26-
only_warn: 1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ tools/ola_trigger/ola_trigger.exe
234234
tools/ola_trigger/FileValidateTest.sh
235235
tools/rdm/DataLocation.py
236236
tools/rdm/ResponderTestTest.sh
237+
tools/rdm/TestHelpersTest.sh
238+
tools/rdm/TestStateTest.sh
237239
tools/rdmpro/rdmpro_sniffer
238240
tools/rdmpro/rdmpro_sniffer.exe
239241
tools/slp/slp_client

.travis-ci.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,24 @@ elif [[ $TASK = 'pychecker' ]]; then
254254
travis_fold end "pychecker_a"
255255
# More restricted checking for files that import files that break pychecker
256256
travis_fold start "pychecker_b"
257-
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST --only $(find ./ -name "*.py" -and \( -wholename "./tools/rdm/ModelCollector.py" -or -wholename "./tools/rdm/DMXSender.py" -or -wholename "./tools/rdm/TestCategory.py" -or -wholename "./tools/rdm/TestHelpers.py" -or -wholename "./tools/rdm/TestState.py" -or -wholename "./tools/rdm/TimingStats.py" -or -wholename "./tools/rdm/list_rdm_tests.py" \) | xargs)
257+
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST --only $(find ./ -name "*.py" -and \( -wholename "./tools/rdm/ModelCollector.py" -or -wholename "./tools/rdm/DMXSender.py" -or -wholename "./tools/rdm/TestCategory.py" -or -wholename "./tools/rdm/TestState.py" -or -wholename "./tools/rdm/TimingStats.py" -or -wholename "./tools/rdm/list_rdm_tests.py" \) | xargs)
258258
travis_fold end "pychecker_b"
259259
# Even more restricted checking for files that import files that break pychecker and have unused parameters
260260
travis_fold start "pychecker_c"
261-
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST --only --no-argsused $(find ./ -name "*.py" -and ! \( -name "*_pb2.py" -or -name "OlaClient.py" -or -name "ola_candidate_ports.py" -or -name "ola_universe_info.py" -or -name "rdm_snapshot.py" -or -name "ClientWrapper.py" -or -name "PidStore.py" -or -name "enforce_licence.py" -or -name "ola_mon.py" -or -name "TestLogger.py" -or -name "TestRunner.py" -or -name "rdm_model_collector.py" -or -name "rdm_responder_test.py" -or -name "rdm_test_server.py" -or -wholename "./include/ola/gen_callbacks.py" \) | xargs)
261+
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST --only --no-argsused $(find ./ -name "*.py" -and ! \( -name "*_pb2.py" -or -name "OlaClient.py" -or -name "ola_candidate_ports.py" -or -name "ola_universe_info.py" -or -name "rdm_snapshot.py" -or -name "ClientWrapper.py" -or -name "PidStore.py" -or -name "enforce_licence.py" -or -name "ola_mon.py" -or -name "TestLogger.py" -or -name "TestRunner.py" -or -name "rdm_model_collector.py" -or -name "rdm_responder_test.py" -or -name "rdm_test_server.py" -or -wholename "./include/ola/gen_callbacks.py" -or -wholename "./tools/rdm/ResponderTest.py" -or -wholename "./tools/rdm/TestHelpers.py" \) | xargs)
262262
travis_fold end "pychecker_c"
263263
# Special case checking for some python 3 compatibility workarounds
264264
travis_fold start "pychecker_d"
265265
pychecker --quiet --limit 500 --no-shadowbuiltin --no-noeffect ./include/ola/gen_callbacks.py
266266
travis_fold end "pychecker_d"
267+
# Special case checking for some python 3 compatibility workarounds that import files that break pychecker
268+
travis_fold start "pychecker_e"
269+
pychecker --quiet --limit 500 --only --no-shadowbuiltin --no-noeffect ./tools/rdm/TestHelpers.py
270+
travis_fold end "pychecker_e"
271+
# Extra special case checking for some python 3 compatibility workarounds that import files that break pychecker and have unused parameters
272+
travis_fold start "pychecker_f"
273+
pychecker --quiet --limit 500 --only --no-argsused --no-shadowbuiltin --no-noeffect ./tools/rdm/ResponderTest.py
274+
travis_fold end "pychecker_f"
267275
elif [[ $TASK = 'pychecker-wip' ]]; then
268276
travis_fold start "autoreconf"
269277
autoreconf -i;

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ jobs:
103103
- os: linux
104104
dist: bionic
105105
arch: arm64
106-
env: TASK='check-licences'
106+
env:
107+
- TASK='check-licences'
108+
- PYTHON='python3'
107109
addons:
108110
apt:
109111
packages:
110112
- *core_build
111-
- *bionic_build_extras_python2
113+
- *bionic_build_extras_python3
112114
- os: linux
113115
dist: bionic
114116
arch: arm64
@@ -428,12 +430,6 @@ jobs:
428430
- CPPUNIT='1.14'
429431
- PROTOBUF='latest'
430432
- LIBFTDI='1'
431-
- os: linux
432-
dist: bionic
433-
arch: arm64
434-
env:
435-
- TASK='flake8'
436-
- PYTHON='python3'
437433
- os: linux
438434
dist: bionic
439435
arch: arm64

common/io/ExtendedSerial.cpp

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,26 @@
3232
#ifdef HAVE_STROPTS_H
3333
// this provides ioctl() definition without conflicting with asm/termios.h
3434
#include <stropts.h>
35+
#else
36+
// otherwise use the sys/ioctl.h version for newer Linux which has dropped the
37+
// stropts.h version
38+
// N.B. This will pull in the kernel definition of struct termios, which may
39+
// conflict with the libc version, so we wouldn't be able to use both in the
40+
// same file
41+
#ifdef HAVE_SYS_IOCTL_H
42+
#include <sys/ioctl.h>
43+
#endif // HAVE_SYS_IOCTL_H
44+
#ifdef HAVE_ASM_TERMBITS_H
45+
#include <asm/termbits.h>
46+
#endif // HAVE_ASM_TERMBITS_H
3547
#endif // HAVE_STROPTS_H
3648

37-
#ifdef HAVE_ASM_TERMIOS_H
38-
// use this not standard termios for custom baud rates
49+
#if defined(HAVE_STROPTS_H) && defined(HAVE_ASM_TERMIOS_H)
50+
// use this non-standard termios for custom baud rates
51+
//
52+
// On newer Linux, this duplicates winsize and termio as they're also defined
53+
// in bits/ioctl-types.h, so only include this header if we also have the
54+
// stropts.h sourced version of ioctl()
3955
//
4056
// On mips architectures, <asm/termios.h> sets some cpp macros which cause
4157
// <cerrno> (included by <ostream>, used by <ola/Logging.h>) to not define
@@ -52,12 +68,15 @@ namespace ola {
5268
namespace io {
5369

5470
bool LinuxHelper::SetDmxBaud(int fd) {
55-
#if defined(HAVE_STROPTS_H) && defined(HAVE_TERMIOS2)
71+
#if (defined(HAVE_STROPTS_H) || \
72+
(defined(HAVE_SYS_IOCTL_H) && defined(HAVE_ASM_TERMBITS_H))) && \
73+
defined(HAVE_TERMIOS2)
5674
static const int rate = 250000;
5775

5876
struct termios2 tio; // linux-specific terminal stuff
5977

6078
if (ioctl(fd, TCGETS2, &tio) < 0) {
79+
OLA_INFO << "Failed to get current serial port settings";
6180
return false;
6281
}
6382

@@ -66,6 +85,7 @@ bool LinuxHelper::SetDmxBaud(int fd) {
6685
tio.c_ispeed = rate;
6786
tio.c_ospeed = rate; // set custom speed directly
6887
if (ioctl(fd, TCSETS2, &tio) < 0) {
88+
OLA_INFO << "Failed to update serial port settings";
6989
return false;
7090
}
7191

@@ -79,9 +99,19 @@ bool LinuxHelper::SetDmxBaud(int fd) {
7999
}
80100
return true;
81101
#else
102+
OLA_INFO << "Failed to set baud rate, due to missing "
103+
#if !defined(HAVE_STROPTS_H)
104+
<< "stropts.h or "
105+
#endif
106+
#if !(defined(HAVE_SYS_IOCTL_H) && defined(HAVE_ASM_TERMBITS_H))
107+
<< "sys/ioctl.h or asm/termbits.h or "
108+
#endif
109+
<< "termios2";
82110
return false;
83111
(void) fd;
84-
#endif // defined(HAVE_STROPTS_H) && defined(HAVE_TERMIOS2)
112+
#endif // (defined(HAVE_STROPTS_H) ||
113+
// (defined(HAVE_SYS_IOCTL_H) && defined(HAVE_ASM_TERMBITS_H))) &&
114+
// defined(HAVE_TERMIOS2)
85115
}
86116
} // namespace io
87117
} // namespace ola

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ AC_CHECK_HEADERS([arpa/inet.h bits/sockaddr.h fcntl.h float.h limits.h \
145145
malloc.h netinet/in.h stdint.h stdlib.h string.h strings.h \
146146
sys/file.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h \
147147
syslog.h termios.h unistd.h])
148-
AC_CHECK_HEADERS([asm/termios.h assert.h dlfcn.h endian.h execinfo.h \
149-
linux/if_packet.h math.h net/ethernet.h stropts.h \
150-
sys/param.h sys/types.h sys/uio.h sysexits.h])
148+
AC_CHECK_HEADERS([asm/termbits.h asm/termios.h assert.h dlfcn.h endian.h \
149+
execinfo.h linux/if_packet.h math.h net/ethernet.h \
150+
stropts.h sys/ioctl.h sys/param.h sys/types.h sys/uio.h \
151+
sysexits.h])
151152
AC_CHECK_HEADERS([winsock2.h winerror.h])
152153
AC_CHECK_HEADERS([random])
153154

include/ola/gen_callbacks.py

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@
1818

1919

2020
from __future__ import print_function
21-
import sys
2221
import textwrap
2322

2423

25-
if sys.version_info >= (3, 0):
26-
try:
27-
xrange
28-
except NameError:
29-
xrange = range
30-
31-
3224
def PrintLongLine(line):
3325
optional_nolint = ''
3426
if len(line) > 80:
@@ -171,11 +163,11 @@ def GenerateBase(number_of_args):
171163
if number_of_args > 0:
172164
optional_comma = ', '
173165

174-
typenames = ', '.join('typename Arg%d' % i for i in xrange(number_of_args))
175-
arg_list = ', '.join('Arg%d arg%d' % (i, i) for i in xrange(number_of_args))
176-
args = ', '.join('arg%d' % i for i in xrange(number_of_args))
166+
typenames = ', '.join('typename Arg%d' % i for i in range(number_of_args))
167+
arg_list = ', '.join('Arg%d arg%d' % (i, i) for i in range(number_of_args))
168+
args = ', '.join('arg%d' % i for i in range(number_of_args))
177169

178-
arg_types = ', '.join('Arg%d' % i for i in xrange(number_of_args))
170+
arg_types = ', '.join('Arg%d' % i for i in range(number_of_args))
179171

180172
# generate the base callback class
181173
print(textwrap.dedent("""\
@@ -272,10 +264,10 @@ def GenerateHelperFunction(bind_count,
272264
if bind_count > 0 or exec_count > 0:
273265
optional_comma = ', '
274266

275-
typenames = (['typename A%d' % i for i in xrange(bind_count)] +
276-
['typename Arg%d' % i for i in xrange(exec_count)])
277-
bind_types = ['A%d' % i for i in xrange(bind_count)]
278-
exec_types = ['Arg%d' % i for i in xrange(exec_count)]
267+
typenames = (['typename A%d' % i for i in range(bind_count)] +
268+
['typename Arg%d' % i for i in range(exec_count)])
269+
bind_types = ['A%d' % i for i in range(bind_count)]
270+
exec_types = ['Arg%d' % i for i in range(exec_count)]
279271
method_types = ', '.join(bind_types + exec_types)
280272
if exec_count > 0:
281273
exec_types = [''] + exec_types
@@ -294,9 +286,9 @@ def GenerateHelperFunction(bind_count,
294286
if is_method:
295287
print(" * @tparam Class the class with the member function.")
296288
print(" * @tparam ReturnType the return type of the callback.")
297-
for i in xrange(bind_count):
289+
for i in range(bind_count):
298290
print(" * @tparam A%d a create-time argument type." % i)
299-
for i in xrange(exec_count):
291+
for i in range(exec_count):
300292
print(" * @tparam Arg%d an exec-time argument type." % i)
301293
if is_method:
302294
print(" * @param object the object to call the member function on.")
@@ -305,7 +297,7 @@ def GenerateHelperFunction(bind_count,
305297
else:
306298
print(" * @param callback the function pointer to use when executing the "
307299
"callback.")
308-
for i in xrange(bind_count):
300+
for i in range(bind_count):
309301
print(" * @param a%d a create-time argument." % i)
310302
if is_method:
311303
print(" * @returns The same return value as the member function.")
@@ -320,7 +312,7 @@ def GenerateHelperFunction(bind_count,
320312
print(' Class* object,')
321313
if bind_count:
322314
print(' ReturnType (%s)(%s),' % (signature, method_types))
323-
for i in xrange(bind_count):
315+
for i in range(bind_count):
324316
suffix = ','
325317
if i == bind_count - 1:
326318
suffix = ') {'
@@ -340,13 +332,13 @@ def GenerateHelperFunction(bind_count,
340332
print(' %sReturnType,' % padding)
341333
else:
342334
print(' %sReturnType>(' % padding)
343-
for i in xrange(bind_count):
335+
for i in range(bind_count):
344336
if i == bind_count - 1 and exec_count == 0:
345337
suffix = '>('
346338
else:
347339
suffix = ','
348340
print(' %sA%d%s' % (padding, i, suffix))
349-
for i in xrange(exec_count):
341+
for i in range(exec_count):
350342
suffix = ','
351343
if i == exec_count - 1:
352344
suffix = '>('
@@ -357,7 +349,7 @@ def GenerateHelperFunction(bind_count,
357349
print(' %s,' % ptr_name)
358350
else:
359351
print(' %s);' % ptr_name)
360-
for i in xrange(bind_count):
352+
for i in range(bind_count):
361353
suffix = ','
362354
if i == bind_count - 1:
363355
suffix = ');'
@@ -380,18 +372,18 @@ def GenerateMethodCallback(bind_count,
380372
if bind_count > 0 or exec_count > 0:
381373
optional_comma = ', '
382374

383-
typenames = (['typename A%d' % i for i in xrange(bind_count)] +
384-
['typename Arg%d' % i for i in xrange(exec_count)])
375+
typenames = (['typename A%d' % i for i in range(bind_count)] +
376+
['typename Arg%d' % i for i in range(exec_count)])
385377

386-
bind_types = ['A%d' % i for i in xrange(bind_count)]
387-
exec_types = ['Arg%d' % i for i in xrange(exec_count)]
378+
bind_types = ['A%d' % i for i in range(bind_count)]
379+
exec_types = ['Arg%d' % i for i in range(exec_count)]
388380

389381
method_types = ', '.join(bind_types + exec_types)
390-
method_args = (['m_a%d' % i for i in xrange(bind_count)] +
391-
['arg%d' % i for i in xrange(exec_count)])
382+
method_args = (['m_a%d' % i for i in range(bind_count)] +
383+
['arg%d' % i for i in range(exec_count)])
392384

393-
exec_args = ', '.join(['Arg%d arg%d' % (i, i) for i in xrange(exec_count)])
394-
bind_args = ', '.join(['A%d a%d' % (i, i) for i in xrange(bind_count)])
385+
exec_args = ', '.join(['Arg%d arg%d' % (i, i) for i in range(exec_count)])
386+
bind_args = ', '.join(['A%d a%d' % (i, i) for i in range(bind_count)])
395387

396388
optional_class, method_or_function, class_name = (
397389
'', 'Function', 'FunctionCallback')
@@ -431,7 +423,7 @@ def GenerateMethodCallback(bind_count,
431423
print(' m_object(object),')
432424
if bind_count:
433425
print(' m_callback(callback),')
434-
for i in xrange(bind_count):
426+
for i in range(bind_count):
435427
suffix = ','
436428
if i == bind_count - 1:
437429
suffix = ' {}'
@@ -450,7 +442,7 @@ def GenerateMethodCallback(bind_count,
450442
if is_method:
451443
print(' Class *m_object;')
452444
print(' %s m_callback;' % method_or_function)
453-
for i in xrange(bind_count):
445+
for i in range(bind_count):
454446
print(' A%d m_a%d;' % (i, i))
455447
print('};')
456448
print('')

javascript/new-src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# web-interface
2-
the web interface for ola is build using
2+
the web interface for ola is built using
33
- [angularjs](http://angularjs.com)
44
- [bootstrap](http://getbootstrap.com)
55
- [jquery](http://jquery.com)

plugins/e131/E131Plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ bool E131Plugin::StartHook() {
9393

9494
if (!StringToInt(m_preferences->GetValue(OUTPUT_PORT_COUNT_KEY),
9595
&options.output_ports)) {
96-
OLA_WARN << "Invalid value for input_ports";
96+
OLA_WARN << "Invalid value for output_ports";
9797
}
9898

9999
m_device = new E131Device(this, cid, ip_addr, m_plugin_adaptor, options);

plugins/e131/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Enable the draft (2014) E1.31 discovery protocol.
2222
Ignore preview data.
2323

2424
`input_ports = [int]`
25-
The number of input ports to create up to a max of 32.
25+
The number of input ports to create up to an arbitrary max of 512.
2626

2727
`ip = [a.b.c.d|<interface_name>]`
2828
The IP address or interface name to bind to. If not specified it will use
2929
the first non-loopback interface.
3030

3131
`output_ports = [int]`
32-
The number of output ports to create up to a max of 32.
32+
The number of output ports to create up to an arbitrary max of 512.
3333

3434
`prepend_hostname = [true|false]`
3535
Prepend the hostname to the source name when sending packets.

0 commit comments

Comments
 (0)