Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/OpenLightingProject/ola i…

…nto eurolite-pro-mk2
  • Loading branch information...
aroffringa committed Apr 14, 2019
2 parents 905cd11 + 4d1d119 commit dc873eb7ea0d8487a9d6768454264370220fbe83
Showing with 1,345 additions and 364 deletions.
  1. +5 −0 .codespellignore
  2. +24 −45 .travis.yml
  3. +9 −2 common/base/Flags.cpp
  4. +2 −2 common/network/AdvancedTCPConnectorTest.cpp
  5. +19 −2 common/network/Interface.cpp
  6. +14 −10 common/network/InterfacePicker.cpp
  7. +8 −14 common/network/InterfacePickerTest.cpp
  8. +17 −1 common/network/InterfaceTest.cpp
  9. +2 −2 common/network/SocketTest.cpp
  10. +1 −1 common/network/TCPConnectorTest.cpp
  11. +417 −0 common/rdm/RDMAPI.cpp
  12. +3 −0 common/utils/StringUtils.cpp
  13. +1 −1 common/web/SchemaParseContext.h
  14. +3 −3 data/rdm/manufacturer_pids.proto
  15. +1 −1 doxygen/rpc.dox
  16. +3 −3 include/ola/network/IPV4Address.h
  17. +19 −1 include/ola/network/Interface.h
  18. +88 −0 include/ola/rdm/RDMAPI.h
  19. +1 −1 include/ola/testing/TestUtils.h
  20. +1 −1 include/ola/web/JsonSections.h
  21. +1 −1 include/olad/PluginAdaptor.h
  22. +3 −3 java/pom.xml
  23. +5 −3 libs/acn/E131Node.cpp
  24. +4 −2 libs/acn/e131_loadtest.cpp
  25. +11 −0 olad/OladHTTPServer.cpp
  26. +245 −0 olad/RDMHTTPModule.cpp
  27. +43 −0 olad/RDMHTTPModule.h
  28. +1 −1 olad/plugin_api/PluginAdaptor.cpp
  29. +5 −5 olad/plugin_api/Preferences.cpp
  30. +31 −28 plugins/espnet/EspNetNode.cpp
  31. +23 −14 plugins/pathport/PathportNode.cpp
  32. +30 −18 plugins/sandnet/SandNetNode.cpp
  33. +22 −14 plugins/shownet/ShowNetNode.cpp
  34. +1 −1 plugins/usbpro/EnttecUsbProWidgetTest.cpp
  35. +1 −1 python/ola/OlaClient.py
  36. +6 −6 python/ola/PidStore.py
  37. +4 −2 tools/e133/e133-monitor.cpp
  38. +233 −142 tools/rdm/ModelCollector.py
  39. +34 −29 tools/rdm/TestDefinitions.py
  40. +2 −2 tools/rdm/TestMixins.py
  41. +1 −1 tools/rdm/rdm_test_server.py
  42. +1 −1 tools/rdm/static/rdm_tests.js
@@ -142,6 +142,8 @@ const char RDMHTTPModule::GENERIC_UINT_FIELD[] = "int";
section.AddItem(new UIntItem(description, value, GENERIC_UINT_FIELD));
SelectItem *item = new SelectItem("Active Curve", GENERIC_UINT_FIELD);
string curve_str = request->GetParameter(GENERIC_UINT_FIELD);
maximum_level, GENERIC_UINT_FIELD));
string s_max_level = request->GetParameter(GENERIC_UINT_FIELD);
s.Xa=function(a){a.keyCode==32&&this.cd(a);return!1};wd("goog-checkbox",function(){return new Jg});function Kg(a,b){var c=b.type,d=b.value,h=b.id;if(c=="hidden"){var g=Q("input");g.id=h;g.type="hidden";g.value=d;a.appendChild(g)}else{g=Q("tr");a.appendChild(g);var j=Q("td");j.innerHTML=b.description;g.appendChild(j);j=Q("td");g.appendChild(j);if(h)if(c=="string"||c=="uint"||c=="hidden"){g=Q("input");g.value=d;g.name=h;if(c=="hidden")g.type="hidden";j.appendChild(g);b.button&&(d=new ed.mf(b.button),S(d,j))}else{if(c=="bool")c=new Jg,c.bc(d==1);else{c=new wg;h=d.length;for(g=0;g<h;++g)c.Ba(new Bg(d[g].label));
function Tg(a){for(var b=a.Vd,c=b.length,d=P(a.za.id()),h="",g=0;g<c;++g){var j=b[g].id;if(j)if(b[g].type=="uint"){var l=d.elements[j].value,n=parseInt(l);if(isNaN(n)){a.Dd("Invalid Value",b[g].description+" must be an integer");return}var o=b[g].min;if(o!=k&&n<o){a.Dd("Invalid Value",b[g].description+" must be > "+(o-1));return}o=b[g].max;if(o!=k&&n>o){a.Dd("Invalid Value",b[g].description+" must be < "+(o+1));return}h+=j+"="+l+"&"}else if(b[g].type=="string")l=d.elements[j].value,h+=j+"="+l+"&";
p.M=function(a){Yc(this.bd,a)};p.B=n("$");p.getParent=n("D");p.u=function(a){this.S=a;this.bd.className=a?"goog-tabpane-tab":"goog-tabpane-tab-disabled"};p.isEnabled=n("S");function dk(a,b){if(a.isEnabled())a.$.style.display=b?"":"none",a.bd.className=b?"goog-tabpane-tab-selected":"goog-tabpane-tab"}p.ue=function(a,b){this.D=a;this.jd=ga(b)?b:l};function ck(a,b,c){E.call(this,a,b);this.page=c}w(ck,E);function ek(a,b,c){ti.call(this,a,b,c);this.Xg(!0)}w(ek,ti);ek.prototype.Ec=function(){return this.dispatchEvent("action")};se("goog-option",function(){return new ek(l)});function fk(a,b){var c=b.type,d=b.value,g=b.id;if(c=="hidden"){var h=P("input");h.id=g;h.type="hidden";h.value=d;a.appendChild(h)}else{h=P("tr");a.appendChild(h);var i=P("td");i.innerHTML=b.description;h.appendChild(i);i=P("td");h.appendChild(i);if(g)if(c=="string"||c=="uint"||c=="hidden"){h=P("input");h.value=d;h.name=g;if(c=="hidden")h.type="hidden";i.appendChild(h);b.button&&(new gk(b.button)).L(i)}else{if(c=="bool")c=new dj,c.Kc(d==1);else{c=new $;g=d.length;for(h=0;h<g;++h)c.bb(new ek(d[h].label));
@@ -166,3 +168,6 @@ function ok(a,b){for(var c=a.wa[b].data.items,d=c.length,g=N(a.wa[b].id),h="",i=
UIntValidator(0, UINT_MAX),
// On win32 TRUE and FALSE are #define'd. We can #undef them here but that
* A #define'd value HAVE_LIBLO which lets us know within the code if the OSC
import java.nio.ByteOrder;
byte[] header = ByteBuffer.allocate(4).order(ByteOrder.nativeOrder()).putInt(headerContent).array();
int headerValue = ByteBuffer.wrap(header).order(ByteOrder.nativeOrder()).getInt();
@@ -104,7 +104,7 @@ matrix:
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: linux
dist: trusty
dist: xenial
compiler: clang
env: TASK='compile'
python: '2.7'
@@ -114,9 +114,9 @@ matrix:
- *core_build_clang_latest
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- llvm-toolchain-xenial-6.0
- os: linux
dist: trusty
dist: xenial
compiler: gcc
env: TASK='compile'
python: '2.7'
@@ -127,7 +127,7 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
dist: xenial
compiler: gcc
env: TASK='coverage'
addons:
@@ -137,7 +137,7 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
dist: xenial
compiler: gcc
env: TASK='coverity'
addons:
@@ -149,9 +149,7 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='doxygen'
addons:
apt:
@@ -162,107 +160,87 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='lint'
addons:
apt:
packages:
- *core_build
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='check-licences'
addons:
apt:
packages:
- *core_build
- os: linux
dist: trusty
# Short duration job, would use the container/without sudo image as it boots faster, but we need a backported lintian, so don't
sudo: required
dist: xenial
env: TASK='spellintian'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: trusty
# Short duration job, would use the container/without sudo image as it boots faster, but we need a backported lintian, so don't
sudo: required
dist: xenial
env: TASK='spellintian-duplicates'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='codespell'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='jshint'
addons:
apt:
packages:
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='flake8'
addons:
apt:
packages:
- *base_build
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='pychecker'
addons:
apt:
packages:
- *base_build
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='pychecker-wip'
addons:
apt:
packages:
- *base_build
allow_failures:
- os: linux
dist: trusty
dist: xenial
compiler: gcc
env: TASK='coverage'
- os: linux
dist: trusty
dist: xenial
compiler: gcc
env: TASK='coverity'
- os: linux
dist: trusty
# Short duration job, use the container/without sudo image as it boots faster
sudo: false
dist: xenial
env: TASK='pychecker-wip'
- os: linux
dist: trusty
dist: xenial
env: TASK='spellintian'
- os: linux
dist: trusty
dist: xenial
env: TASK='spellintian-duplicates'

env:
@@ -293,6 +271,7 @@ cache:
- $HOME/.cache/pip # pip cache
- $HOME/.npm # npm cache
- $HOME/.ccache # ccache cache
- $HOME/.m2 # maven cache

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log # erase log
@@ -302,14 +281,14 @@ install:
# Match the version of protobuf being installed via apt
  - if [[ "$PROTOBUF" == "3.6" ]]; then pip install --user protobuf==3.6.0; fi
- if [[ "$PROTOBUF" != "3.6" ]]; then pip install --user protobuf==3.1.0; fi
# We need to use pip rather than apt on Trusty
# We need to use pip rather than apt on Xenial
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install --user numpy; fi
- if [ "$TASK" = "coverage" ]; then pip install --user cpp-coveralls; fi
- if [ "$TASK" = "flake8" ]; then pip install --user flake8; fi
- if [ "$TASK" = "codespell" ]; then pip install --user git+https://github.com/codespell-project/codespell.git; fi
- if [ "$TASK" = "jshint" ]; then npm install -g grunt-cli; fi
# If this causes SSL errors, then Sourceforge is probably in disaster recovery mode and needing Javascript. Could switch to a specific mirror, e.g. kent.dl.sourceforge.net
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then pip install --user http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then sudo pip install http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
@@ -334,7 +313,7 @@ before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-6.0" CC="clang-6.0"; fi
#Report the compiler version
- $CXX --version
- if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then sudo add-apt-repository ppa:waja/trusty-backports -y; sudo apt-get update -qq; sudo apt-get install lintian -y; fi # Install a late enough lintian
- if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian

after_failure:
# Disabled as otherwise the logfile is too big
@@ -358,8 +358,15 @@ void FlagRegistry::GenManPage() {
str << " <" << flag->arg_type() << ">";
}
if (flag->short_opt()) {
short_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
if (flag->name() == FLAGS_version.name()) {
std::ostringstream help_str;
help_str << "Print\n.B " << exe_name << "\nversion information.";
short_flag_lines.push_back(
OptionPair(str.str(), help_str.str()));
} else {
short_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
}
} else {
long_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
@@ -399,7 +399,7 @@ uint16_t AdvancedTCPConnectorTest::ReservePort() {
void AdvancedTCPConnectorTest::AcceptedConnection(TCPSocket *new_socket) {
OLA_ASSERT_NOT_NULL(new_socket);
GenericSocketAddress address = new_socket->GetPeerAddress();
OLA_ASSERT_TRUE(address.Family() == AF_INET);
OLA_ASSERT_EQ(address.Family(), static_cast<uint16_t>(AF_INET));
OLA_INFO << "Connection from " << address;

// terminate the ss when this connection is closed
@@ -415,7 +415,7 @@ void AdvancedTCPConnectorTest::OnConnect(TCPSocket *socket) {
OLA_ASSERT_NOT_NULL(socket);

GenericSocketAddress address = socket->GetPeerAddress();
OLA_ASSERT_TRUE(address.Family() == AF_INET);
OLA_ASSERT_EQ(address.Family(), static_cast<uint16_t>(AF_INET));
OLA_ASSERT_EQ(m_localhost, address.V4Addr().Host());

m_connected_socket = socket;
@@ -117,16 +117,32 @@ Interface& Interface::operator=(const Interface &other) {
}


bool Interface::operator==(const Interface &other) {
bool Interface::operator==(const Interface &other) const {
return (name == other.name &&
ip_address == other.ip_address &&
bcast_address == other.bcast_address &&
subnet_mask == other.subnet_mask &&
hw_address == other.hw_address &&
loopback == other.loopback &&
index == other.index &&
type == other.type);
}


string Interface::ToString(const string &separator) const {
std::ostringstream str;
str << name << separator
<< "Index: " << index << separator
<< "IP: " << ip_address << separator
<< "Broadcast: " << bcast_address << separator
<< "Subnet: " << subnet_mask << separator
<< "Type: " << type << separator
<< "MAC: " << hw_address << separator
<< "Loopback: " << loopback;
return str.str();
}


/**
* Create a new interface builder
*/
@@ -228,8 +244,9 @@ Interface InterfaceBuilder::Construct() {
bool InterfaceBuilder::SetAddress(const string &str,
IPV4Address *target) {
IPV4Address tmp_address;
if (!IPV4Address::FromString(str, &tmp_address))
if (!IPV4Address::FromString(str, &tmp_address)) {
return false;
}
*target = tmp_address;
return true;
}
@@ -44,7 +44,7 @@ using std::vector;
* @param iface, the interface to populate
* @param ip_or_name the IP address or interface name of the local interface
* we'd prefer to use.
* @param options a Options struct configuring ChooseInterface
* @param options an Options struct configuring ChooseInterface
* @return true if we found an interface, false otherwise
*/
// TODO(Simon): Change these to callback based code to reduce duplication.
@@ -84,13 +84,15 @@ bool InterfacePicker::ChooseInterface(
}
}

if (!found && options.specific_only)
if (!found && options.specific_only) {
return false; // No match and being fussy
}

if (!found)
if (!found) {
*iface = interfaces[0];
OLA_DEBUG << "Using interface " << iface->name << " (" <<
iface->ip_address << ")";
}
OLA_DEBUG << "Using interface " << iface->name << " ("
<< iface->ip_address << ")";
return true;
}

@@ -99,7 +101,7 @@ bool InterfacePicker::ChooseInterface(
* Select an interface to use by index
* @param iface, the interface to populate
* @param index the index of the local interface we'd prefer to use.
* @param options a Options struct configuring ChooseInterface
* @param options an Options struct configuring ChooseInterface
* @return true if we found an interface, false otherwise
*/
// TODO(Simon): Change these to callback based code to reduce duplication.
@@ -125,13 +127,15 @@ bool InterfacePicker::ChooseInterface(
}
}

if (!found && options.specific_only)
if (!found && options.specific_only) {
return false; // No match and being fussy
}

if (!found)
if (!found) {
*iface = interfaces[0];
OLA_DEBUG << "Using interface " << iface->name << " (" <<
iface->ip_address << ") with index " << iface->index;
}
OLA_DEBUG << "Using interface " << iface->name << " ("
<< iface->ip_address << ") with index " << iface->index;
return true;
}

0 comments on commit dc873eb

Please sign in to comment.
You can’t perform that action at this time.