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 nanoleaf
  • Loading branch information
peternewman committed Sep 10, 2018
2 parents 78f3cc3 + 6cd72f8 commit efccdfd
Show file tree
Hide file tree
Showing 23 changed files with 930 additions and 237 deletions.
101 changes: 101 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,104 @@ 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));
SelectItem *item = new SelectItem("Active Curve", GENERIC_UINT_FIELD);
string curve_str = 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));
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
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ matrix:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.13'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.13'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: clang
Expand Down
4 changes: 2 additions & 2 deletions README.developer
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Structure packing syntax differs between platforms and compilers. If you declare
a struct or class that needs to be packed, use the PACK() macro from
ola/base/Macro.h . See below for an example of PACK() usage.

Not that this macro doesn't work for enums. See plugins/espnet/EspNetPackets.h
Note that this macro doesn't work for enums. See plugins/espnet/EspNetPackets.h
for an example of how to pack an enum.

Non x86 platforms
Expand All @@ -122,7 +122,7 @@ uint16_t *ptr = &foo.value2;
// Bug! Will not be true on all platforms.
if (*ptr == 2)

http://www.aleph1.co.uk/chapter-10-arm-structured-alignment-faq has a good
http://netwinder.osuosl.org/users/b/brianbr/public_html/alignment.html has a good
explanation.


Expand Down
4 changes: 2 additions & 2 deletions common/network/MACAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ struct ether_addr {
#endif // HAVE_NETINET_IF_ETHER_H
#endif // _WIN32

#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__DragonFly__)
// In the FreeBSD struct ether_addr, the single field is named octet, instead
// of ether_addr_octet.
// OS X does this too, but avoids it by adding the following line to its
// header, for compatibility with linux and others:
// http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/net/ethernet.h
#define ether_addr_octet octet
#endif // __FreeBSD__
#endif // defined(__FreeBSD__) || defined(__DragonFly__)

#include <assert.h>
#include <string.h>
Expand Down
8 changes: 4 additions & 4 deletions common/network/PosixInterfacePicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -222,11 +222,11 @@ vector<Interface> PosixInterfacePicker::GetInterfaces(
if (ioctl(sd, SIOCGIFINDEX, &ifrcopy) < 0) {
OLA_WARN << "ioctl error " << strerror(errno);
} else {
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__DragonFly__)
interface.index = ifrcopy.ifr_index;
#else
interface.index = ifrcopy.ifr_ifindex;
#endif // SIOCGIFINDEX
#endif // defined(__FreeBSD__) || defined(__DragonFly__)
}
}
#elif defined(HAVE_IF_NAMETOINDEX)
Expand All @@ -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
Expand Down
Loading

0 comments on commit efccdfd

Please sign in to comment.