Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into DaAwesomeP-debian-s…
Browse files Browse the repository at this point in the history
…ystemd-and-config-dir
  • Loading branch information
DaAwesomeP committed Oct 23, 2023
2 parents 2abcdb8 + 8556eea commit cb606a0
Show file tree
Hide file tree
Showing 20 changed files with 211 additions and 159 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pkg: "gcc g++"
- id: "distcheck-debian-stable-amd64-gcc"
task: "distcheck"
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests --enable-java-libs"
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests"
# TODO(Perry): Fix Debian 12 OOM issue on GitHub Actions
container: "debian:stable"
compiler:
Expand All @@ -30,7 +30,7 @@ jobs:
pkg: "gcc g++"
- id: "distcheck-debian-stable-amd64-clang"
task: "distcheck"
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests --enable-java-libs"
configure-args: "--enable-ja-rule --enable-e133 --enable-rdm-tests"
# TODO(Perry): Fix Debian 12 OOM issue on GitHub Actions
container: "debian:stable"
compiler:
Expand All @@ -50,13 +50,13 @@ jobs:
run: apt-get update -y
# See comments beginning at
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
# Without Git, actions/checkout@v3 will resort to REST and will not
# Without Git, actions/checkout@v4 will resort to REST and will not
# create a .git folder or .git.config. The Problem Matcher looks for
# .git/config to find where the root of the repo is, so it must be
# present.
- name: Install Git
run: apt-get -y install git
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME
- name: Install build tools
Expand Down Expand Up @@ -92,17 +92,18 @@ jobs:
- name: Autoreconf
run: sudo --preserve-env -u builduser env "PATH=$PATH" autoreconf -i
- name: Set configure arguments
# Env var name DISTCHECK_CONFIGURE_FLAGS must be used, see #1881 and #1883
run: |
echo "GH_OLA_CONFIGURE_ARGS=${{ matrix.configure-args }}" >> $GITHUB_ENV
echo "DISTCHECK_CONFIGURE_FLAGS=${{ matrix.configure-args }}" >> $GITHUB_ENV
- name: Set additional Linux configure arguments
if: runner.os == 'Linux'
# Silence all deprecated declarations on Linux due to auto_ptr making the build log too long
run: |
echo "GH_OLA_CONFIGURE_ARGS=$GH_OLA_CONFIGURE_ARGS CPPFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV
echo "DISTCHECK_CONFIGURE_FLAGS=$DISTCHECK_CONFIGURE_FLAGS CPPFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV
- name: Print configure command
run: echo "./configure $GH_OLA_CONFIGURE_ARGS"
run: echo "./configure $DISTCHECK_CONFIGURE_FLAGS"
- name: Configure
run: sudo --preserve-env -u builduser env "PATH=$PATH" ./configure $GH_OLA_CONFIGURE_ARGS
run: sudo --preserve-env -u builduser env "PATH=$PATH" ./configure $DISTCHECK_CONFIGURE_FLAGS
- name: ${{ matrix.task }}
run: sudo --preserve-env -u builduser env "PATH=$PATH" make ${{ matrix.task }} -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} VERBOSE=1
- name: Display structure of the built files
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
run: apt-get update -y
# See comments beginning at
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
# Without Git, actions/checkout@v3 will resort to REST and will not
# Without Git, actions/checkout@v4 will resort to REST and will not
# create a .git folder or .git.config. The Problem Matcher looks for
# .git/config to find where the root of the repo is, so it must be
# present.
- name: Install Git and lsb-release
run: apt-get -y install git lsb-release
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME
- name: Generate build name
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
run: apt-get update -y
- name: Install Git and lsb-release
run: apt-get -y install git lsb-release
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all tags for generating OLA_DEBIAN_BUILD_VERSION
- name: Generate build name # Job step outputs can't be passed between builds for matrix jobs, so we re-generate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: isort/isort-action@v1
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
run: apt-get update -y
# See comments beginning at
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
# Without Git, actions/checkout@v3 will resort to REST and will not
# Without Git, actions/checkout@v4 will resort to REST and will not
# create a .git folder or .git.config. The Problem Matcher looks for
# .git/config to find where the root of the repo is, so it must be
# present.
- name: Install Git
run: apt-get -y install git
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build tools
shell: bash
run: |
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
name: weblint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js v18
uses: actions/setup-node@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ elif [[ $TASK = 'pychecker-wip' ]]; then
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST $(find ./ -name "*.py" -and ! \( -name "*_pb2.py" -or -name "OlaClient.py" -or -name "ola_candidate_ports.py" \) | xargs)
else
# Otherwise compile and check as normal
# Env var name DISTCHECK_CONFIGURE_FLAGS must be used, see #1881 and #1883
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
# Silence all deprecated declarations on Linux due to auto_ptr making the build log too long
export DISTCHECK_CONFIGURE_FLAGS='--enable-rdm-tests --enable-java-libs --enable-ja-rule --enable-e133 CPPFLAGS=-Wno-deprecated-declarations'
Expand Down
2 changes: 1 addition & 1 deletion README.developer
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The release lifecycle is:
- New feature work occurs on the master branch.
- Once the new features are considered stable or enough time has passed, a new
minor release branch will be created, e.g. 0.10.
- The minor release branch will be stablized with bugfixes, these bug fixes
- The minor release branch will be stabilized with bugfixes, these bug fixes
will also be merged back into master.
- Once declared stable, a new patch branch 0 will be created e.g. 0.10.0
- Release specific changes like the version number, debian files etc. will be
Expand Down
8 changes: 8 additions & 0 deletions common/messaging/DescriptorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using ola::messaging::BoolFieldDescriptor;
using ola::messaging::FieldDescriptor;
using ola::messaging::FieldDescriptorGroup;
using ola::messaging::IPV4FieldDescriptor;
using ola::messaging::MACFieldDescriptor;
using ola::messaging::StringFieldDescriptor;
using ola::messaging::UIDFieldDescriptor;
using ola::messaging::UInt16FieldDescriptor;
Expand Down Expand Up @@ -76,6 +77,13 @@ void DescriptorTest::testFieldDescriptors() {
OLA_ASSERT_TRUE(ipv4_descriptor.LimitedSize());
OLA_ASSERT_EQ(4u, ipv4_descriptor.MaxSize());

// MAC address
MACFieldDescriptor mac_descriptor("mac");
OLA_ASSERT_EQ(string("mac"), mac_descriptor.Name());
OLA_ASSERT_TRUE(mac_descriptor.FixedSize());
OLA_ASSERT_TRUE(mac_descriptor.LimitedSize());
OLA_ASSERT_EQ(6u, mac_descriptor.MaxSize());

// UID
UIDFieldDescriptor uid_descriptor("uid");
OLA_ASSERT_EQ(string("uid"), uid_descriptor.Name());
Expand Down
18 changes: 13 additions & 5 deletions common/messaging/MessagePrinterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@
using std::string;
using std::vector;
using ola::rdm::UID;
using ola::network::MACAddress;


using ola::messaging::BoolFieldDescriptor;
using ola::messaging::BoolMessageField;
using ola::messaging::FieldDescriptor;
using ola::messaging::FieldDescriptorGroup;
using ola::messaging::GroupMessageField;
using ola::messaging::IPV4FieldDescriptor;
using ola::messaging::GenericMessagePrinter;
using ola::messaging::IPV4MessageField;
using ola::messaging::GroupMessageField;
using ola::messaging::Int16FieldDescriptor;
using ola::messaging::Int16MessageField;
using ola::messaging::Int8FieldDescriptor;
using ola::messaging::Int8MessageField;
using ola::messaging::IPV4FieldDescriptor;
using ola::messaging::IPV4MessageField;
using ola::messaging::MACFieldDescriptor;
using ola::messaging::MACMessageField;
using ola::messaging::Message;
using ola::messaging::MessageFieldInterface;
using ola::messaging::StringFieldDescriptor;
Expand Down Expand Up @@ -87,6 +90,7 @@ void GenericMessagePrinterTest::testSimplePrinter() {
// setup some fields
BoolFieldDescriptor bool_descriptor("On/Off");
IPV4FieldDescriptor ipv4_descriptor("ip");
MACFieldDescriptor mac_descriptor("mac");
UIDFieldDescriptor uid_descriptor("uid");
StringFieldDescriptor string_descriptor("Name", 0, 32);
UInt32FieldDescriptor uint32_descriptor("Id");
Expand All @@ -100,6 +104,9 @@ void GenericMessagePrinterTest::testSimplePrinter() {
fields.push_back(
new IPV4MessageField(&ipv4_descriptor,
ola::network::HostToNetwork(0x0a000001)));
fields.push_back(
new MACMessageField(&mac_descriptor,
MACAddress::FromStringOrDie("01:23:45:67:89:ab")));
fields.push_back(new UIDMessageField(&uid_descriptor, UID(0x7a70, 1)));
fields.push_back(new StringMessageField(&string_descriptor, "foobar"));
fields.push_back(new UInt32MessageField(&uint32_descriptor, 42));
Expand All @@ -109,8 +116,9 @@ void GenericMessagePrinterTest::testSimplePrinter() {

Message message(fields);
string expected = (
"On/Off: false\nip: 10.0.0.1\nuid: 7a70:00000001\nName: foobar\nId: 42\n"
"Count: 4 x 10 ^ -3\nDelta: 10 x 10 ^ 1\nRate: 10 x 10 ^ -1\n");
"On/Off: false\nip: 10.0.0.1\nmac: 01:23:45:67:89:ab\n"
"uid: 7a70:00000001\nName: foobar\nId: 42\nCount: 4 x 10 ^ -3\n"
"Delta: 10 x 10 ^ 1\nRate: 10 x 10 ^ -1\n");
OLA_ASSERT_EQ(expected, m_printer.AsString(&message));
}

Expand Down
11 changes: 7 additions & 4 deletions common/rdm/GroupSizeCalculatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ using ola::messaging::IPV4FieldDescriptor;
using ola::messaging::Int16FieldDescriptor;
using ola::messaging::Int32FieldDescriptor;
using ola::messaging::Int8FieldDescriptor;
using ola::messaging::MACFieldDescriptor;
using ola::messaging::StringFieldDescriptor;
using ola::messaging::UIDFieldDescriptor;
using ola::messaging::UInt16FieldDescriptor;
Expand Down Expand Up @@ -83,6 +84,7 @@ void GroupSizeCalculatorTest::testSimpleCases() {
fields.push_back(new Int8FieldDescriptor("int8"));
fields.push_back(new Int16FieldDescriptor("int16"));
fields.push_back(new Int32FieldDescriptor("int32"));
fields.push_back(new MACFieldDescriptor("mac"));
fields.push_back(new StringFieldDescriptor("string", 0, 32));
fields.push_back(new IPV4FieldDescriptor("address"));
fields.push_back(new UIDFieldDescriptor("uid"));
Expand All @@ -91,7 +93,8 @@ void GroupSizeCalculatorTest::testSimpleCases() {
unsigned int token_count, group_repeat_count;
OLA_ASSERT_TRUE(
m_static_calculator.CalculateTokensRequired(&descriptor, &token_count));
OLA_ASSERT_EQ(10u, token_count);
OLA_ASSERT_EQ(11u, token_count); // Actual token count


OLA_ASSERT_EQ(
GroupSizeCalculator::INSUFFICIENT_TOKENS,
Expand All @@ -103,21 +106,21 @@ void GroupSizeCalculatorTest::testSimpleCases() {
OLA_ASSERT_EQ(
GroupSizeCalculator::INSUFFICIENT_TOKENS,
m_calculator.CalculateGroupSize(
9,
10, // Actual token count - 1
&descriptor,
&group_repeat_count));

OLA_ASSERT_EQ(
GroupSizeCalculator::NO_VARIABLE_GROUPS,
m_calculator.CalculateGroupSize(
10,
11, // Actual token count
&descriptor,
&group_repeat_count));

OLA_ASSERT_EQ(
GroupSizeCalculator::EXTRA_TOKENS,
m_calculator.CalculateGroupSize(
11,
12, // Actual token count + 1
&descriptor,
&group_repeat_count));
}
Expand Down
2 changes: 1 addition & 1 deletion common/rpc/RpcChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void RpcChannel::DescriptorReady() {
m_buffer_size = AllocateMsgBuffer(m_expected_size);

if (m_buffer_size < m_expected_size) {
OLA_WARN << "buffer size to small " << m_buffer_size << " < " <<
OLA_WARN << "buffer size too small: " << m_buffer_size << " < " <<
m_expected_size;
return;
}
Expand Down
23 changes: 19 additions & 4 deletions examples/ola-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ typedef struct {
string cmd; // argv[0]
string uni_name; // universe name
string dmx; // DMX string
bool blackout;
ola::port_priority_mode priority_mode; // port priority mode
uint8_t priority_value; // port priority value
bool list_plugin_ids;
Expand Down Expand Up @@ -304,6 +305,7 @@ void InitOptions(options *opts) {
opts->port_direction = ola::client::OUTPUT_PORT;
opts->device_id = INVALID_VALUE;
opts->merge_mode = OlaUniverse::MERGE_HTP;
opts->blackout = false;
opts->priority_mode = ola::PRIORITY_MODE_INHERIT;
opts->priority_value = 0;
}
Expand Down Expand Up @@ -358,6 +360,7 @@ void ParseOptions(int argc, char *argv[], options *opts) {

static struct option long_options[] = {
{"dmx", required_argument, 0, 'd'},
{"blackout", no_argument, 0, 'b'},
{"help", no_argument, 0, 'h'},
{"ltp", no_argument, 0, 'l'},
{"name", required_argument, 0, 'n'},
Expand All @@ -373,7 +376,7 @@ void ParseOptions(int argc, char *argv[], options *opts) {
int option_index = 0;

while (1) {
c = getopt_long(argc, argv, "ld:n:u:p:s:hv", long_options, &option_index);
c = getopt_long(argc, argv, "ld:bn:u:p:s:hv", long_options, &option_index);

if (c == -1)
break;
Expand All @@ -384,6 +387,9 @@ void ParseOptions(int argc, char *argv[], options *opts) {
case 'd':
opts->dmx = optarg;
break;
case 'b':
opts->blackout = true;
break;
case 'h':
opts->help = true;
break;
Expand Down Expand Up @@ -656,7 +662,8 @@ void DisplayUniverseMergeHelp(const options &opts) {
* Help message for set dmx
*/
void DisplaySetDmxHelp(const options &opts) {
cout << "Usage: " << opts.cmd << " --universe <universe> --dmx <values>\n"
cout << "Usage: " << opts.cmd << " --universe <universe> [ --dmx <values> ] "
"[ --blackout ]\n"
"\n"
"Sets the DMX values for a universe.\n"
"\n"
Expand All @@ -665,6 +672,7 @@ void DisplaySetDmxHelp(const options &opts) {
" -d, --dmx <values> Comma separated DMX values, e.g. "
"0,255,128 sets first channel to 0, second channel to 255"
" and third channel to 128.\n"
" -b, --blackout Send a universe to blackout instead.\n"
<< endl;
}

Expand Down Expand Up @@ -857,9 +865,16 @@ int SendDmx(OlaClientWrapper *wrapper, const options &opts) {
SelectServer *ss = wrapper->GetSelectServer();
OlaClient *client = wrapper->GetClient();
ola::DmxBuffer buffer;
bool status = buffer.SetFromString(opts.dmx);
bool status = false;
if (opts.blackout) {
status = buffer.Blackout();
} else {
status = buffer.SetFromString(opts.dmx);
}

if (opts.uni < 0 || !status || buffer.Size() == 0) {
// A dmx string and blackout are mutually exclusive
if (opts.uni < 0 || !status || (opts.blackout && !opts.dmx.empty()) ||
buffer.Size() == 0) {
DisplaySetDmxHelp(opts);
exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion include/ola/io/MemoryBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MemoryBlock {

/**
* @brief Move the insertation point to the end of the block.
* This is useful if you want to use the block in pre-pend mode.
* This is useful if you want to use the block in prepend mode.
*/
void SeekBack() {
m_first = m_data_end;
Expand Down
2 changes: 1 addition & 1 deletion include/ola/rdm/StringMessageBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @addtogroup rdm_helpers
* @{
* @file include/ola/rdm/StringMessageBuilder.h
* @brief Builds a Messagse object from a list of strings and a Descriptor.
* @brief Builds a Message object from a list of strings and a Descriptor.
* @}
*/

Expand Down
Loading

0 comments on commit cb606a0

Please sign in to comment.