From 6bc08a9d970f190daf56a121bd59d1177b95aeea Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Mon, 31 Mar 2025 00:59:13 +0100 Subject: [PATCH] Add the simple enums and mappings from E1.20-2025 --- common/rdm/RDMHelper.cpp | 84 +++++++++++++++++++++++++++++++++ include/ola/rdm/RDMEnums.h | 62 +++++++++++++++++++++++- plugins/usbpro/DmxTriWidget.cpp | 21 +++++++++ plugins/usbpro/DmxTriWidget.h | 9 +++- python/ola/OlaClient.py | 7 +++ python/ola/RDMConstants.py | 25 ++++++++++ 6 files changed, 206 insertions(+), 2 deletions(-) diff --git a/common/rdm/RDMHelper.cpp b/common/rdm/RDMHelper.cpp index 956266022..80ef69a4e 100644 --- a/common/rdm/RDMHelper.cpp +++ b/common/rdm/RDMHelper.cpp @@ -109,6 +109,26 @@ string DataTypeToString(uint8_t type) { return "uint32"; case DS_SIGNED_DWORD: return "int32"; + case DS_UINT64: + return "uint64"; + case DS_INT64: + return "int64"; + case DS_GROUP: + return "Group"; + case DS_UID: + return "UID"; + case DS_BOOLEAN: + return "Boolean"; + case DS_URL: + return "URL"; + case DS_MAC: + return "MAC"; + case DS_IPV4: + return "IPv4"; + case DS_IPV6: + return "IPv6"; + case DS_ENUMERATION: + return "Enumeration"; default: ostringstream str; str << "Unknown, was " << static_cast(type); @@ -211,6 +231,20 @@ string NackReasonToString(uint16_t reason) { return "Invalid IPv6 address"; case NR_INVALID_PORT: return "Invalid port"; + case NR_DEVICE_ABSENT: + return "Device absent"; + case NR_SENSOR_OUT_OF_RANGE: + return "Sensor out of range"; + case NR_SENSOR_FAULT: + return "Sensor faulty"; + case NR_PACKING_NOT_SUPPORTED: + return "Packing not supported"; + case NR_ERROR_IN_PACKED_LIST_TRANSACTION: + return "Error actioning packed list"; + case NR_PROXY_DROP: + return "Proxy drop"; + case NR_ALL_CALL_SET_FAIL: + return "Set all sub devices failed"; default: ostringstream str; str << "Unknown, was " << reason; @@ -621,6 +655,10 @@ string ProductDetailToString(uint16_t detail) { return "Battery"; case PRODUCT_DETAIL_CONTROLLABLE_BREAKER: return "Controllable Breaker"; + case PRODUCT_DETAIL_INPUT_DEVICE: + return "Input Device"; + case PRODUCT_DETAIL_SENSOR_INPUT: + return "Sensor Input"; case PRODUCT_DETAIL_OTHER: return "Other Device"; default: @@ -738,6 +776,22 @@ string SensorTypeToString(uint8_t type) { return "Humidity"; case SENSOR_COUNTER_16BIT: return "16 bit counter"; + case SENSOR_CPU_LOAD: + return "CPU load"; + case SENSOR_BANDWIDTH: + return "Bandwidth"; + case SENSOR_CONCENTRATION: + return "Concentration"; + case SENSOR_SOUND_PRESSURE_LEVEL: + return "Sound pressure level"; + case SENSOR_SOLID_ANGLE: + return "Solid angle"; + case SENSOR_LOG_RATIO: + return "Log ratio"; + case SENSOR_LOG_RATIO_VOLTS: + return "Log ratio volts"; + case SENSOR_LOG_RATIO_WATTS: + return "Log ratio watts"; case SENSOR_OTHER: return "Other"; default: @@ -799,6 +853,18 @@ string SlotInfoToString(uint8_t slot_type, uint16_t slot_label) { return "Primary, color correction"; case SD_COLOR_SCROLL: return "Primary, scroll"; + case SD_COLOR_ADD_LIME: + return "Primary, additive lime"; + case SD_COLOR_ADD_INDIGO: + return "Primary, additive indigo"; + case SD_COLOR_ADD_CYAN: + return "Primary, additive cyan"; + case SD_COLOR_ADD_DEEP_RED: + return "Primary, additive deep red"; + case SD_COLOR_ADD_DEEP_BLUE: + return "Primary, additive deep blue"; + case SD_COLOR_ADD_NATURAL_WHITE: + return "Primary, additive natural white"; case SD_COLOR_SEMAPHORE: return "Primary, color semaphore"; case SD_COLOR_ADD_AMBER: @@ -815,6 +881,8 @@ string SlotInfoToString(uint8_t slot_type, uint16_t slot_label) { return "Primary, hue"; case SD_COLOR_SATURATION: return "Primary, saturation"; + case SD_COLOR_ADD_UV: + return "Primary, additive UV"; case SD_STATIC_GOBO_WHEEL: return "Primary, static gobo wheel"; case SD_ROTO_GOBO_WHEEL: @@ -1140,6 +1208,22 @@ string UnitToString(uint8_t unit) { return "ire"; case UNITS_BYTE: return "bytes"; + case UNITS_DECIBEL: + return "dB"; + case UNITS_DECIBEL_VOLT: + return "dB(V)"; + case UNITS_DECIBEL_WATT: + return "dB(W)"; + case UNITS_DECIBEL_METER: + return "dB meter"; + case UNITS_PERCENT: + return "%"; + case UNITS_MOLES_PER_METER_CUBED: + return "mol/m^3"; + case UNITS_RPM: + return "RPM"; + case UNITS_BYTE_PER_SECOND: + return "bps"; default: ostringstream str; str << "Unknown, was " << static_cast(unit); diff --git a/include/ola/rdm/RDMEnums.h b/include/ola/rdm/RDMEnums.h index 8f8b3a10b..eb7770a13 100644 --- a/include/ola/rdm/RDMEnums.h +++ b/include/ola/rdm/RDMEnums.h @@ -77,9 +77,15 @@ typedef enum { PID_STATUS_ID_DESCRIPTION = 0x0031, PID_CLEAR_STATUS_ID = 0x0032, PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD = 0x0033, + PID_QUEUED_MESSAGE_SENSOR_SUBSCRIBE = 0x0034, // RDM information PID_SUPPORTED_PARAMETERS = 0x0050, PID_PARAMETER_DESCRIPTION = 0x0051, + PID_SUPPORTED_PARAMETERS_ENHANCED = 0x0055, + PID_CONTROLLER_FLAG_SUPPORT = 0x0056, + PID_NACK_DESCRIPTION = 0x0057, + PID_PACKED_PID_SUB = 0x0058, + PID_PACKED_PID_INDEX = 0x0059, // production information PID_DEVICE_INFO = 0x0060, PID_PRODUCT_DETAIL_ID_LIST = 0x0070, @@ -250,6 +256,9 @@ typedef enum { } rdm_status_type; +// Remember to update the other places when adding new sensor types: +// common/rdm/RDMHelper.cpp +// python/ola/RDMConstants.py typedef enum { SENSOR_TEMPERATURE = 0x00, SENSOR_VOLTAGE = 0x01, @@ -284,9 +293,20 @@ typedef enum { SENSOR_ITEMS = 0x1E, SENSOR_HUMIDITY = 0x1F, SENSOR_COUNTER_16BIT = 0x20, + SENSOR_CPU_LOAD = 0x21, + SENSOR_BANDWIDTH = 0x22, + SENSOR_CONCENTRATION = 0x23, + SENSOR_SOUND_PRESSURE_LEVEL = 0x24, + SENSOR_SOLID_ANGLE = 0x25, + SENSOR_LOG_RATIO = 0x26, + SENSOR_LOG_RATIO_VOLTS = 0x27, + SENSOR_LOG_RATIO_WATTS = 0x28, SENSOR_OTHER = 0x7F, } rdm_sensor_type; +// Remember to update the other places when adding new sensor units: +// common/rdm/RDMHelper.cpp +// python/ola/RDMConstants.py typedef enum { UNITS_NONE = 0x00, UNITS_CENTIGRADE = 0x01, @@ -317,6 +337,14 @@ typedef enum { UNITS_LUX = 0x1A, UNITS_IRE = 0x1B, UNITS_BYTE = 0x1C, + UNITS_DECIBEL = 0x1D, + UNITS_DECIBEL_VOLT = 0x1E, + UNITS_DECIBEL_WATT = 0x1F, + UNITS_DECIBEL_METER = 0x20, + UNITS_PERCENT = 0x21, + UNITS_MOLES_PER_METER_CUBED = 0x22, + UNITS_RPM = 0x23, + UNITS_BYTE_PER_SECOND = 0x24, } rdm_pid_unit; @@ -362,6 +390,16 @@ typedef enum { DS_SIGNED_WORD = 0x06, DS_UNSIGNED_DWORD = 0x07, DS_SIGNED_DWORD = 0x08, + DS_UINT64 = 0x09, + DS_INT64 = 0x0a, + DS_GROUP = 0x0b, + DS_UID = 0x0c, + DS_BOOLEAN = 0x0d, + DS_URL = 0x0e, + DS_MAC = 0x0f, + DS_IPV4 = 0x10, + DS_IPV6 = 0x11, + DS_ENUMERATION = 0x12, } rdm_data_type; @@ -390,7 +428,14 @@ typedef enum { NR_INVALID_STATIC_CONFIG_TYPE = 0x0010, NR_INVALID_IPV4_ADDRESS = 0x0011, NR_INVALID_IPV6_ADDRESS = 0x0012, - NR_INVALID_PORT = 0x0013 + NR_INVALID_PORT = 0x0013, + NR_DEVICE_ABSENT = 0x0014, + NR_SENSOR_OUT_OF_RANGE = 0x0015, + NR_SENSOR_FAULT = 0x0016, + NR_PACKING_NOT_SUPPORTED = 0x0017, + NR_ERROR_IN_PACKED_LIST_TRANSACTION = 0x0018, + NR_PROXY_DROP = 0x0019, + NR_ALL_CALL_SET_FAIL = 0x0020 } rdm_nack_reason; @@ -460,6 +505,9 @@ typedef enum { // product details +// Remember to update the other places when adding new product detail: +// common/rdm/RDMHelper.cpp +// python/ola/RDMConstants.py typedef enum { PRODUCT_DETAIL_NOT_DECLARED = 0x0000, PRODUCT_DETAIL_ARC = 0x0001, @@ -540,6 +588,8 @@ typedef enum { PRODUCT_DETAIL_GFI_RCD = 0x0A00, PRODUCT_DETAIL_BATTERY = 0x0A01, PRODUCT_DETAIL_CONTROLLABLE_BREAKER = 0x0A02, + PRODUCT_DETAIL_INPUT_DEVICE = 0x0B00, + PRODUCT_DETAIL_SENSOR_INPUT = 0x0B01, PRODUCT_DETAIL_OTHER = 0x7FFF, } rdm_product_detail; @@ -560,6 +610,9 @@ typedef enum { } rdm_slot_type; +// Remember to update the other places when adding new slot definitions: +// common/rdm/RDMHelper.cpp +// python/ola/RDMConstants.py /** * @brief The RDM slot definitions, from table C-2 of the standard. */ @@ -577,6 +630,12 @@ typedef enum { SD_COLOR_ADD_BLUE = 0x0207, SD_COLOR_CORRECTION = 0x0208, SD_COLOR_SCROLL = 0x0209, + SD_COLOR_ADD_LIME = 0x020A, + SD_COLOR_ADD_INDIGO = 0x020B, + SD_COLOR_ADD_CYAN = 0x020C, + SD_COLOR_ADD_DEEP_RED = 0x020D, + SD_COLOR_ADD_DEEP_BLUE = 0x020E, + SD_COLOR_ADD_NATURAL_WHITE = 0x020F, SD_COLOR_SEMAPHORE = 0x0210, SD_COLOR_ADD_AMBER = 0x0211, SD_COLOR_ADD_WHITE = 0x0212, @@ -585,6 +644,7 @@ typedef enum { SD_COLOR_SUB_UV = 0x0215, SD_COLOR_HUE = 0x0216, SD_COLOR_SATURATION = 0x0217, + SD_COLOR_ADD_UV = 0x0218, SD_STATIC_GOBO_WHEEL = 0x0301, SD_ROTO_GOBO_WHEEL = 0x0302, SD_PRISM_WHEEL = 0x0303, diff --git a/plugins/usbpro/DmxTriWidget.cpp b/plugins/usbpro/DmxTriWidget.cpp index d8b98461d..07435e3e8 100644 --- a/plugins/usbpro/DmxTriWidget.cpp +++ b/plugins/usbpro/DmxTriWidget.cpp @@ -1018,6 +1018,27 @@ bool DmxTriWidgetImpl::ReturnCodeToNackReason( case EC_INVALID_PORT: *reason = ola::rdm::NR_INVALID_PORT; break; + case EC_DEVICE_ABSENT: + *reason = ola::rdm::NR_DEVICE_ABSENT; + break; + case EC_SENSOR_OUT_OF_RANGE: + *reason = ola::rdm::NR_SENSOR_OUT_OF_RANGE; + break; + case EC_SENSOR_FAULT: + *reason = ola::rdm::NR_SENSOR_FAULT; + break; + case EC_PACKING_NOT_SUPPORTED: + *reason = ola::rdm::NR_PACKING_NOT_SUPPORTED; + break; + case EC_ERROR_IN_PACKED_LIST_TRANSACTION: + *reason = ola::rdm::NR_ERROR_IN_PACKED_LIST_TRANSACTION; + break; + case EC_PROXY_DROP: + *reason = ola::rdm::NR_PROXY_DROP; + break; + case EC_ALL_CALL_SET_FAIL: + *reason = ola::rdm::NR_ALL_CALL_SET_FAIL; + break; default: return false; } diff --git a/plugins/usbpro/DmxTriWidget.h b/plugins/usbpro/DmxTriWidget.h index 1b9f28a34..bb3e9560f 100644 --- a/plugins/usbpro/DmxTriWidget.h +++ b/plugins/usbpro/DmxTriWidget.h @@ -199,7 +199,14 @@ class DmxTriWidgetImpl: public BaseUsbProWidget, EC_INVALID_STATIC_CONFIG_TYPE = 0x30, // this is a guess EC_INVALID_IPV4_ADDRESS = 0x31, // this is a guess EC_INVALID_IPV6_ADDRESS = 0x32, // this is a guess - EC_INVALID_PORT = 0x33 // this is a guess + EC_INVALID_PORT = 0x33, // this is a guess + EC_DEVICE_ABSENT = 0x34, // this is a guess + EC_SENSOR_OUT_OF_RANGE = 0x35, // this is a guess + EC_SENSOR_FAULT = 0x36, // this is a guess + EC_PACKING_NOT_SUPPORTED = 0x37, // this is a guess + EC_ERROR_IN_PACKED_LIST_TRANSACTION = 0x38, // this is a guess + EC_PROXY_DROP = 0x39, // this is a guess + EC_ALL_CALL_SET_FAIL = 0x3a // this is a guess } dmx_tri_error_codes; // The RDM NACK code is currently bitwise or-ed with 0x20 to generate the // error code diff --git a/python/ola/OlaClient.py b/python/ola/OlaClient.py index f10eb4f0d..327911ba7 100644 --- a/python/ola/OlaClient.py +++ b/python/ola/OlaClient.py @@ -458,6 +458,13 @@ class RDMNack(object): 'NR_INVALID_IPV4_ADDRESS': (17, 'Invalid IPv4 address'), 'NR_INVALID_IPV6_ADDRESS': (18, 'Invalid IPv6 address'), 'NR_INVALID_PORT': (19, 'Invalid port'), + 'NR_DEVICE_ABSENT': (20, 'Device absent'), + 'NR_SENSOR_OUT_OF_RANGE': (21, 'Sensor out of range'), + 'NR_SENSOR_FAULT': (22, 'Sensor faulty'), + 'NR_PACKING_NOT_SUPPORTED': (23, 'Packing not supported'), + 'NR_ERROR_IN_PACKED_LIST_TRANSACTION': (24, 'Error actioning packed list'), + 'NR_PROXY_DROP': (25, 'Proxy drop'), + 'NR_ALL_CALL_SET_FAIL': (26, 'Set all sub devices failed'), } # this is populated below diff --git a/python/ola/RDMConstants.py b/python/ola/RDMConstants.py index 736f75051..40a6567b2 100644 --- a/python/ola/RDMConstants.py +++ b/python/ola/RDMConstants.py @@ -85,6 +85,14 @@ def _ReverseDict(input): 'SENSOR_ITEMS': 0x1E, 'SENSOR_HUMIDITY': 0x1F, 'SENSOR_COUNTER_16BIT': 0x20, + 'SENSOR_CPU_LOAD': 0x21, + 'SENSOR_BANDWIDTH': 0x22, + 'SENSOR_CONCENTRATION': 0x23, + 'SENSOR_SOUND_PRESSURE_LEVEL': 0x24, + 'SENSOR_SOLID_ANGLE': 0x25, + 'SENSOR_LOG_RATIO': 0x26, + 'SENSOR_LOG_RATIO_VOLTS': 0x27, + 'SENSOR_LOG_RATIO_WATTS': 0x28, 'SENSOR_OTHER': 0x7F, } @@ -121,6 +129,14 @@ def _ReverseDict(input): 'UNITS_LUX': 0x1A, 'UNITS_IRE': 0x1B, 'UNITS_BYTE': 0x1C, + 'UNITS_DECIBEL': 0x1D, + 'UNITS_DECIBEL_VOLT': 0x1E, + 'UNITS_DECIBEL_WATT': 0x1F, + 'UNITS_DECIBEL_METER': 0x20, + 'UNITS_PERCENT': 0x21, + 'UNITS_MOLES_PER_METER_CUBED': 0x22, + 'UNITS_RPM': 0x23, + 'UNITS_BYTE_PER_SECOND': 0x24, } UNIT_TO_NAME = _ReverseDict(UNITS) @@ -297,6 +313,8 @@ def _ReverseDict(input): 'PRODUCT_DETAIL_GFI_RCD': 0x0A00, 'PRODUCT_DETAIL_BATTERY': 0x0A01, 'PRODUCT_DETAIL_CONTROLLABLE_BREAKER': 0x0A02, + 'PRODUCT_DETAIL_INPUT_DEVICE': 0x0B00, + 'PRODUCT_DETAIL_SENSOR_INPUT': 0x0B01, 'PRODUCT_DETAIL_OTHER': 0x7FFF, } @@ -330,6 +348,12 @@ def _ReverseDict(input): 'SD_COLOR_ADD_BLUE': 0x0207, 'SD_COLOR_CORRECTION': 0x0208, 'SD_COLOR_SCROLL': 0x0209, + 'SD_COLOR_ADD_LIME': 0x020A, + 'SD_COLOR_ADD_INDIGO': 0x020B, + 'SD_COLOR_ADD_CYAN': 0x020C, + 'SD_COLOR_ADD_DEEP_RED': 0x020D, + 'SD_COLOR_ADD_DEEP_BLUE': 0x020E, + 'SD_COLOR_ADD_NATURAL_WHITE': 0x020F, 'SD_COLOR_SEMAPHORE': 0x0210, 'SD_COLOR_ADD_AMBER': 0x0211, 'SD_COLOR_ADD_WHITE': 0x0212, @@ -338,6 +362,7 @@ def _ReverseDict(input): 'SD_COLOR_SUB_UV': 0x0215, 'SD_COLOR_HUE': 0x0216, 'SD_COLOR_SATURATION': 0x0217, + 'SD_COLOR_ADD_UV': 0x0218, 'SD_STATIC_GOBO_WHEEL': 0x0301, 'SD_ROTO_GOBO_WHEEL': 0x0302, 'SD_PRISM_WHEEL': 0x0303,