Skip to content
Permalink
Browse files

Merge pull request #1606 from peternewman/0.10-c11-compat

New E1.37-7 NACK Reasons and some other minor improvements
  • Loading branch information
peternewman committed Jan 26, 2020
2 parents cea3b67 + 2c5db3a commit 7bcba609fa43959c860e4afceab5e7b105d428f0
@@ -196,7 +196,11 @@ string NackReasonToString(uint16_t reason) {
case NR_ACTION_NOT_SUPPORTED:
return "Action not supported";
case NR_ENDPOINT_NUMBER_INVALID:
return "Invalid endpoint";
return "Endpoint number invalid";
case NR_INVALID_ENDPOINT_MODE:
return "Invalid endpoint mode";
case NR_UNKNOWN_UID:
return "Unknown UID";
default:
ostringstream str;
str << "Unknown, was " << reason;
@@ -435,13 +435,16 @@ void CapitalizeLabel(string *s) {
}

void CustomCapitalizeLabel(string *s) {
// Remember to update the Doxygen in include/ola/StringUtils.h too
static const char* const transforms[] = {
"dhcp",
"dmx",
"dns",
"ip",
"ipv4", // Should really be IPv4 probably, but better than nothing
"ipv6", // Should really be IPv6 probably, but better than nothing
"led",
"mdmx", // City Theatrical, should really be mDMX, but better than nothing
"rdm",
"uid",
NULL
@@ -924,7 +924,7 @@ fi
AC_SUBST(PLUGIN_LIBS)
AC_SUBST(OLA_SERVER_LIBS)

# html & data directories
# HTML & data directories
ola_datadir=$datadir/olad
www_datadir=$ola_datadir/www
piddatadir=$datadir/ola/pids
@@ -1005,5 +1005,5 @@ Now type 'make @<:@<target>@:>@'
where the optional <target> is:
all - build everything
check - run the tests
doxygen-doc - generate the html documentation
doxygen-doc - generate the HTML documentation
-------------------------------------------------------"
@@ -441,8 +441,16 @@ void CapitalizeLabel(std::string *s);
*
* @param s a string to transform.
* The following are capitalized:
* - ip
* - dhcp
* - dmx
* - dns
* - ip
* - ipv4
* - ipv6
* - led
* - mdmx
* - rdm
* - uid
*/
void CustomCapitalizeLabel(std::string *s);

@@ -326,6 +326,11 @@ typedef enum {
} rdm_data_type;


// Remember to update the other places when adding new NACK codes:
// common/rdm/RDMHelper.cpp
// plugins/usbpro/DmxTriWidget.cpp
// plugins/usbpro/DmxTriWidget.h
// python/ola/OlaClient.py
typedef enum {
NR_UNKNOWN_PID = 0x0000,
NR_FORMAT_ERROR = 0x0001,
@@ -339,7 +344,9 @@ typedef enum {
NR_SUB_DEVICE_OUT_OF_RANGE = 0x0009,
NR_PROXY_BUFFER_FULL = 0x000A,
NR_ACTION_NOT_SUPPORTED = 0x000B,
NR_ENDPOINT_NUMBER_INVALID = 0x0011
NR_ENDPOINT_NUMBER_INVALID = 0x000C,
NR_INVALID_ENDPOINT_MODE = 0x000D,
NR_UNKNOWN_UID = 0x000E
} rdm_nack_reason;


@@ -34,7 +34,7 @@ namespace web {
* This is the base item class. Items are composed into sections.
* Each item has the following:
* - A text description
* - A type, which controls how the item is renders
* - A type, which controls how the item is rendered
* - The value.
* - Optional id. A non-empty id makes this item editable
* - Optional button text. Non-empty means this item gets it own button.
@@ -320,7 +320,7 @@ class LibUsbAdaptor {
* output (depending on direction bits within bmRequestType)
* @param wLength the length field for the setup packet. The data buffer
* should be at least this size.
* @param timeout timeout (in millseconds) that this function should wait
* @param timeout timeout (in milliseconds) that this function should wait
* before giving up due to no response being received. For an unlimited
* timeout, use value 0.
* @returns on success, the number of bytes actually transferred
@@ -35,7 +35,7 @@ for man_file in *.1; do
output_file=$output_dir/man1/$man_file.html;
man2html -r $man_file -M ../index.html | sed 1,2d > $output_file;
chmod a+r $output_file;
echo "<li><a href='./man1/$man_file.html'>$man_file</a></li>" >> $index_file
echo "<li><a href='./man1/$man_file.html'>$man_file</a> - `grep "\.SH NAME" $man_file -A 1 | tail -n 1 | sed -e 's/\\\-/-/g'`</li>" >> $index_file
done

cat << 'EOF' >> $index_file
@@ -988,6 +988,18 @@ bool DmxTriWidgetImpl::ReturnCodeToNackReason(
case EC_PROXY_BUFFER_FULL:
*reason = ola::rdm::NR_PROXY_BUFFER_FULL;
break;
case EC_ACTION_NOT_SUPPORTED:
*reason = ola::rdm::NR_ACTION_NOT_SUPPORTED;
break;
case EC_ENDPOINT_NUMBER_INVALID:
*reason = ola::rdm::NR_ENDPOINT_NUMBER_INVALID;
break;
case EC_INVALID_ENDPOINT_MODE:
*reason = ola::rdm::NR_INVALID_ENDPOINT_MODE;
break;
case EC_UNKNOWN_UID:
*reason = ola::rdm::NR_UNKNOWN_UID;
break;
default:
return false;
}
@@ -191,7 +191,12 @@ class DmxTriWidgetImpl: public BaseUsbProWidget,
EC_FRAME_OVERFLOW = 0x28,
EC_SUBDEVICE_UNKNOWN = 0x29,
EC_PROXY_BUFFER_FULL = 0x2a, // this isn't included in the docs
EC_ACTION_NOT_SUPPORTED = 0x2b, // this is a guess
EC_ENDPOINT_NUMBER_INVALID = 0x2c, // this is a guess
EC_INVALID_ENDPOINT_MODE = 0x2d, // this is a guess
EC_UNKNOWN_UID = 0x2e, // this is a guess
} dmx_tri_error_codes;
// TODO(Peter): try and test the guessed values

static const unsigned int DATA_OFFSET = 2; // first two bytes are CI & RC
static const uint8_t EXTENDED_COMMAND_LABEL = 88; // 'X'
@@ -399,6 +399,10 @@ class RDMNack(object):
'NR_PACKET_SIZE_UNSUPPORTED': (8, 'Packet size unsupported'),
'NR_SUB_DEVICE_OUT_OF_RANGE': (9, 'Sub device out of range'),
'NR_PROXY_BUFFER_FULL': (10, 'Proxy buffer full'),
'NR_ACTION_NOT_SUPPORTED': (11, 'Action not supported'),
'NR_ENDPOINT_NUMBER_INVALID': (12, 'Endpoint number invalid'),
'NR_INVALID_ENDPOINT_MODE': (13, 'Invalid endpoint mode'),
'NR_UNKNOWN_UID': (14, 'Unknown UID'),
}

# this is populated below

0 comments on commit 7bcba60

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