Permalink
Browse files

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

…nto protobuf-3.6
  • Loading branch information...
peternewman committed Aug 16, 2018
2 parents 10e1237 + 1f99585 commit 8cd07ad6f2679429d383df7b0e3181fb26853387
@@ -64,3 +64,102 @@ const uint8_t BaseRobeWidget::SOM;
manufacturer_name: "ARRI -- Arnold & Richter Cine Technik GmbH & Co. Betriebs KG"
manufacturer_name: "SRM Technik GmbH"
manufacturer_name: "medien technik cords"
STLDeleteValues(&m_uint_map_variables);
return GetMapVar(&m_uint_map_variables, name, label);
STLValues(m_uint_map_variables, &variables);
auto_ptr<JsonUInt> m_uint_value;
m_uint_value.reset(new JsonUInt(4));
m_uint_value->Accept(&wildcard_validator);
m_uint_value->Accept(&validator);
m_uint_value->Accept(&basic_string_validator);
m_uint_value->Accept(&bool_validator);
m_uint_value->Accept(&null_validator);
m_uint_value->Accept(&integer_validator);
auto_ptr<JsonInt> uint_value1(new JsonInt(5));
m_uint_value->Accept(&max_int_validator);
uint_value1->Accept(&max_int_validator);
m_uint_value->Accept(&exclusive_max_int_validator);
uint_value1->Accept(&max_int_validator);
m_uint_value->Accept(&min_int_validator);
m_uint_value->Accept(&exclusive_min_int_validator);
m_uint_value->Accept(&multiple_of_validator);
m_uint_value->Accept(&integer_validator);
m_uint_value->Accept(&object_validator);
m_uint_value->Accept(&array_validator);
m_uint_value->Accept(&all_of_validator);
m_uint_value->Accept(&any_of_validator);
m_uint_value->Accept(&one_of_validator);
m_uint_value->Accept(&not_validator);
JsonInt uint_value1(2);
JsonInt uint_value2(3);
m_uint_value->Accept(&integer_validator);
uint_value1.Accept(&integer_validator);
uint_value2.Accept(&integer_validator);
JsonUInt uint_value(10);
OLA_ASSERT_EQ(expected, JsonWriter::AsString(uint_value));
* Test the uint item
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
std::map<std::string, UIntMap*> m_uint_map_variables;
if (message.uint_offset < MAX_UINT_FIELDS) {
message.uint16_fields[message.uint_offset++] = field->Value();
iter->uint_offset != MAX_UINT_FIELDS ||
enum { MAX_UINT_FIELDS = 2 };
uint16_t uint16_fields[MAX_UINT_FIELDS];
uint8_t uint_offset;
status_message() : uint_offset(0), int_offset(0), status_type(0),
std::string Type() const { return "uint"; }
if (items[i]['type'] == 'uint') {
if (items[i]['type'] == 'uint') {
if (type == 'string' || type == 'uint' || type == 'hidden') {
const char RDMHTTPModule::GENERIC_UINT_FIELD[] = "int";
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
SelectItem *item = new SelectItem("Personality", GENERIC_UINT_FIELD);
string personality_str = request->GetParameter(GENERIC_UINT_FIELD);
UIntItem *uint_item = new UIntItem("DMX Start Address", address,
uint_item->SetMin(DMX_MIN_SLOT_NUMBER);
uint_item->SetMax(DMX_MAX_SLOT_NUMBER);
item = uint_item;
string device_hours = request->GetParameter(GENERIC_UINT_FIELD);
string lamp_hours_str = request->GetParameter(GENERIC_UINT_FIELD);
string lamp_strikes_str = request->GetParameter(GENERIC_UINT_FIELD);
SelectItem *item = new SelectItem("Lamp State", GENERIC_UINT_FIELD);
string lamp_state_str = request->GetParameter(GENERIC_UINT_FIELD);
SelectItem *item = new SelectItem("Lamp Mode", GENERIC_UINT_FIELD);
string lamp_mode_str = request->GetParameter(GENERIC_UINT_FIELD);
string power_cycles_str = request->GetParameter(GENERIC_UINT_FIELD);
UIntItem *item = new UIntItem("Display Level", value, GENERIC_UINT_FIELD);
string display_level_str = request->GetParameter(GENERIC_UINT_FIELD);
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
SelectItem *item = new SelectItem("Power State", GENERIC_UINT_FIELD);
string power_state_str = request->GetParameter(GENERIC_UINT_FIELD);
SelectItem *item = new SelectItem("Reset Device", GENERIC_UINT_FIELD);
string reset_device_str = request->GetParameter(GENERIC_UINT_FIELD);
section.AddItem(new UIntItem(description, value, 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));
function ok(a,b){for(var c=a.wa[b].data.items,d=c.length,g=N(a.wa[b].id),h="",i=0;i<d;++i){var k=c[i].id;if(k)if(c[i].type=="uint"){var m=g.elements[k].value,q=parseInt(m);if(isNaN(q)){a.Mb("Invalid Value",c[i].description+" must be an integer");return}var t=c[i].min;if(t!=j&&q<t){a.Mb("Invalid Value",c[i].description+" must be > "+(t-1));return}t=c[i].max;if(t!=j&&q>t){a.Mb("Invalid Value",c[i].description+" must be < "+(t+1));return}h+=k+"="+m+"&"}else if(c[i].type=="string")m=g.elements[k].value,
UIntValidator uint_validator(10, 14);
OLA_ASSERT(uint_validator.IsValid("10"));
OLA_ASSERT(uint_validator.IsValid("14"));
OLA_ASSERT_FALSE(uint_validator.IsValid("0"));
OLA_ASSERT_FALSE(uint_validator.IsValid("9"));
OLA_ASSERT_FALSE(uint_validator.IsValid("15"));
// test get/set/has single values uint
// test get/set multiple value uint
// test SetDefaultValue uint
UIntValidator uint_validator(0, 3);
OLA_ASSERT(preferences->SetDefaultValue(key1, uint_validator, value3));
OLA_ASSERT_FALSE(preferences->SetDefaultValue(key1, uint_validator,
const char *uint_vars[] = {
for (unsigned int i = 0; i < arraysize(uint_vars); ++i) {
m_export_map->GetUIntMapVar(uint_vars[i])->Remove(m_universe_id_str);
static const char GENERIC_UINT_FIELD[];
if ((uint) r != buffer.Size()) {
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
@@ -38,7 +38,7 @@
#endif // HAVE_SYS_SOCKET_H
#include <arpa/inet.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h> // Required by FreeBSD
#include <netinet/in.h> // Required by FreeBSD
#endif // HAVE_NETINET_IN_H
#include <errno.h>
#include <net/if.h>
@@ -226,7 +226,7 @@ vector<Interface> PosixInterfacePicker::GetInterfaces(
interface.index = ifrcopy.ifr_index;
#else
interface.index = ifrcopy.ifr_ifindex;
#endif // SIOCGIFINDEX
#endif // __FreeBSD__
}
}
#elif defined(HAVE_IF_NAMETOINDEX)
@@ -235,7 +235,7 @@ vector<Interface> PosixInterfacePicker::GetInterfaces(
if (index != 0) {
interface.index = index;
}
#endif // defined(HAVE_IF_NAMETOINDEX)
#endif // SIOCGIFINDEX

/* ok, if that all failed we should prob try and use sysctl to work out the
* broadcast and hardware addresses
@@ -556,7 +556,12 @@ void JsonTest::testLookups() {
JsonString string1("foo");
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(&string1),
string1.LookupElement(empty_pointer));

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
string1.LookupElement(invalid_pointer));

// Now try an object
@@ -571,7 +576,12 @@ void JsonTest::testLookups() {
object.LookupElement(empty_pointer));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(name_value),
object.LookupElement(name_pointer));

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
object.LookupElement(invalid_pointer));

// Now try an array
@@ -591,17 +601,33 @@ void JsonTest::testLookups() {

OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(array),
array->LookupElement(empty_pointer));

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(invalid_pointer));

OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string2),
array->LookupElement(first));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string3),
array->LookupElement(middle));
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(string4),
array->LookupElement(last));

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(one_past_last));

#ifdef __FreeBSD__
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(0),
#else
OLA_ASSERT_EQ(reinterpret_cast<JsonValue*>(NULL),
#endif // __FreeBSD__
array->LookupElement(invalid));

// now a nested case
@@ -27,7 +27,7 @@ AC_CHECK_HEADERS([resolv.h])
am_save_LDFLAGS="$LDFLAGS"
RESOLV_LIBS=""

acx_resolv_libs="-lresolv -resolv"
acx_resolv_libs="-lresolv -resolv -lc"
for lib in $acx_resolv_libs; do
acx_resolv_ok=no
LDFLAGS="$am_save_LDFLAGS $lib"
@@ -1,28 +1,29 @@
.TH olad 1 "July 2013"
.TH olad 1 "August 2018"
.SH NAME
olad \- The Open Lighting Architecture Daemon
.SH SYNOPSIS
.B olad [ options ]
.B olad
[options]
.SH DESCRIPTION
.B olad
is the Open Lighting Architecture (OLA) daemon. It handles communication
with DMX512 / RDM hardware devices and remote network hosts via various
lighting control protocols.
.SH OPTIONS
.IP "-c, --config-dir"
Path to the config directory. Defaults to ~/.ola
.IP "-c, --config-dir <string>"
The path to the config directory, defaults to ~/.ola/ on *nix and %LOCALAPPDATA%\.ola\ on Windows.
.IP "-d, --http-data-dir <string>"
The path to the static www content.
.IP "-f, --daemon"
Fork and run as a background process.
.IP "-h, --help"
Display the help message
.IP "-i, --interface <string>"
The interface name (e.g. eth0) or IP address of the network interface to use
The interface name (e.g. eth0) or IP address of the network interface to use for the web server.
.IP "-l, --log-level <int8_t>"
Set the logging level 0 .. 4. See LOGGING.
.IP "-p, --http-port <uint16_t>"
Port to run the http server on. Defaults to 9090.
The port to run the HTTP server on. Defaults to 9090.
.IP "-r, --rpc-port <uint16_t>"
The port to listen for RPCs on. Defaults to 9010.
.IP "-v, --version"
@@ -33,22 +34,22 @@ version information
Disable the HTTP server.
.IP "--no-http-quit"
Disable the HTTP /quit handler.
.IP "--pid-location <string>"
The directory containing the PID definitions
.IP "--syslog"
Send to syslog rather than stderr.
.IP "--no-register-with-dns-sd"
Don't register the web service using DNS-SD (Bonjour).
.IP "--no-use-async-libusb"
Disable the use of the asynchronous libusb calls, revert to synchronous
.IP "--no-use-epoll"
Disable the use of epoll(), revert to select()
.IP "--no-use-kqueue"
Disable the use of kqueue(), revert to select()
.IP "--no-use-async-libusb"
Disable the use of the asynchronous libusb calls, revert to synchronous
.IP "--pid-location <string>"
The directory containing the PID definitions.
.IP "--scheduler-policy <policy>"
The thread scheduling policy, one of {fifo, rr}.
.IP "--scheduler-priority <priority>"
The thread priority, only used if --scheduler-policy is set.
.IP "--syslog"
Send to syslog rather than stderr.
.SH LOGGING
.B olad
can either log to
@@ -110,7 +110,11 @@ TCPSocket *ConnectToServer(unsigned short port) {
// Try to start the server, we pass --daemon (fork into background) and
// --syslog (log to syslog).
execlp("olad", "olad", "--daemon", "--syslog",
#ifdef __FreeBSD__
reinterpret_cast<char*>(0));
#else
reinterpret_cast<char*>(NULL));
#endif // __FreeBSD__
OLA_WARN << "Failed to exec: " << strerror(errno);
_exit(1);
}
@@ -48,7 +48,7 @@
#include "olad/Preferences.h"

DEFINE_s_string(config_dir, c, "",
"The path to the config directory, Defaults to ~/.ola/ " \
"The path to the config directory, defaults to ~/.ola/ " \
"on *nix and %LOCALAPPDATA%\\.ola\\ on Windows.");

namespace ola {
@@ -185,7 +185,7 @@ bool OlaServer::Init() {
if (!picker->ChooseInterface(&iface, m_options.network_interface)) {
OLA_WARN << "No network interface found";
} else {
// default to using the ip as a id
// default to using the ip as an id
m_default_uid = ola::rdm::UID(OPEN_LIGHTING_ESTA_CODE,
iface.ip_address.AsInt());
}
@@ -52,16 +52,17 @@ using std::endl;
DEFINE_default_bool(http, true, "Disable the HTTP server.");
DEFINE_default_bool(http_quit, true, "Disable the HTTP /quit handler.");
#ifndef _WIN32
DEFINE_s_default_bool(daemon, f, false, "Fork and run in the background.");
DEFINE_s_default_bool(daemon, f, false,
"Fork and run as a background process.");
#endif // _WIN32
DEFINE_s_string(http_data_dir, d, "", "The path to the static www content.");
DEFINE_s_string(interface, i, "",
"The interface name (e.g. eth0) or IP of the network interface "
"to use.");
"The interface name (e.g. eth0) or IP address of the network "
"interface to use for the web server.");
DEFINE_string(pid_location, "",
"The directory containing the PID definitions.");
DEFINE_s_uint16(http_port, p, ola::OlaServer::DEFAULT_HTTP_PORT,
"The port to run the http server on. Defaults to 9090.");
"The port to run the HTTP server on. Defaults to 9090.");

/**
* This is called by the SelectServer loop to start up the SignalThread. If the
Oops, something went wrong.

0 comments on commit 8cd07ad

Please sign in to comment.