From 887ce0f5a44d4a5a93868df987956922c2d951c7 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Tue, 2 May 2023 12:59:26 -0400 Subject: [PATCH] comprehensive parameter descriptions --- protocol/esta/rdm/E1.37-1.h | 286 ++++++++++++-- protocol/esta/rdm/E1.37-2.h | 182 ++++++++- protocol/esta/rdm/E1.37-7.h | 237 ++++++++++-- protocol/esta/rdm/message.cpp | 4 +- protocol/esta/rdm/parameter.cpp | 152 +++++--- protocol/esta/rdm/parameter.h | 44 ++- protocol/esta/rdm/rdm.cpp | 30 ++ protocol/esta/rdm/rdm.h | 641 +++++++++++++++++++++++++++---- protocol/esta/rdmnet/llrp/llrp.h | 48 +-- 9 files changed, 1380 insertions(+), 244 deletions(-) diff --git a/protocol/esta/rdm/E1.37-1.h b/protocol/esta/rdm/E1.37-1.h index 113e9f0..91e4e63 100644 --- a/protocol/esta/rdm/E1.37-1.h +++ b/protocol/esta/rdm/E1.37-1.h @@ -24,6 +24,7 @@ #pragma once #include +#include "parameterdescription.h" /** * \ingroup RDM @@ -32,45 +33,268 @@ * Dimmer Message Sets */ namespace RDM { + // Appendix A: Defined Parameters (Normative) - using PID = uint16_t; + // Table A-1: RDM Parameter ID Defines + // Category – DMX512 Setup + /// \cite e137-1 3.3 Get/Set DMX512 Block Address (DMX_BLOCK_ADDRESS) + constexpr ParameterDescription DMX_BLOCK_ADDRESS = { + .pid = 0x0140, + .pdl = { + .get_response = 4, + .set = 2, + }, + .command_class = CC_GET_SET, + .description = "DMX512 Block Address", + }; + /// \cite e137-1 3.4 Get/Set DMX512 Fail Mode (DMX_FAIL_MODE) + constexpr ParameterDescription DMX_FAIL_MODE = { + .pid = 0x0141, + .pdl = { + .get_response = 7, + .set = 7, + }, + .command_class = CC_GET_SET, + .description = "DMX512 Fail Mode", + }; + /// \cite e137-1 3.5 Get/Set DMX512 Startup Mode (DMX_STARTUP_MODE) + constexpr ParameterDescription DMX_STARTUP_MODE = { + .pid = 0x0142, + .pdl = { + .get_response = 7, + .set = 7, + }, + .command_class = CC_GET_SET, + .description = "DMX512 Startup Mode", + }; - /// Appendix A: Defined Parameters (Normative) + // Category – Dimmer Settings + /// \cite e137-1 4.3 Get Dimmer Info (DIMMER_INFO) + constexpr ParameterDescription DIMMER_INFO = { + .pid = 0x0340, + .pdl = { + .get_response = 0x0b, + }, + .command_class = CC_GET, + .description = "Dimmer Info", + }; + /// \cite e137-1 4.4 Get/Set Minimum Level (MINIMUM_LEVEL) + constexpr ParameterDescription MINIMUM_LEVEL = { + .pid = 0x0341, + .pdl = { + .get_response = 5, + .set = 5, + }, + .command_class = CC_GET_SET, + .description = "Minimum Level", + }; + /// \cite e137-1 4.5 Get/Set Maximum Level (MAXIMUM_LEVEL) + constexpr ParameterDescription MAXIMUM_LEVEL = { + .pid = 0x0342, + .pdl = { + .get_response = 2, + .set = 2, + }, + .command_class = CC_GET_SET, + .description = "Maximum Level", + }; + /// \cite e137-1 4.6 Get/Set Curve (CURVE) + constexpr ParameterDescription CURVE = { + .pid = 0x0343, + .pdl = { + .get_response = 2, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Curve", + }; + /// \cite e137-1 4.7 Get Curve Description (CURVE_DESCRIPTION) + constexpr ParameterDescription CURVE_DESCRIPTION = { + .pid = 0x0344, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET, + .description = "Curve Description", + }; + /// \cite e137-1 4.8 Get/Set Output Response Time (OUTPUT_RESPONSE_TIME) + constexpr ParameterDescription OUTPUT_RESPONSE_TIME = { + .pid = 0x0345, + .pdl = { + .get_response = 2, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Output Response Time", + }; + /// \cite e137-1 4.9 Get Response Time Description (OUTPUT_RESPONSE_TIME_DESCRIPTION) + constexpr ParameterDescription OUTPUT_RESPONSE_TIME_DESCRIPTION = { + .pid = 0x0346, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET, + .description = "Response Time Description", + }; + /// \cite e137-1 4.10 Get/Set Modulation Frequency (MODULATION_FREQUENCY) + constexpr ParameterDescription MODULATION_FREQUENCY = { + .pid = 0x0347, + .pdl = { + .get_response = 2, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Modulation Frequency", + }; + /// \cite e137-1 4.11 Get Modulation Frequency Description (MODULATION_FREQUENCY_DESCRIPTION) + constexpr ParameterDescription MODULATION_FREQUENCY_DESCRIPTION = { + .pid = 0x0348, + .pdl = { + .get_response = 5, + .set = 1, + }, + .command_class = CC_GET, + .description = "Modulation Frequency Descripti", + }; - /// Table A-1: RDM Parameter ID Defines - /// Category – DMX512 Setup - static const PID DMX_BLOCK_ADDRESS = 0x0140; - static const PID DMX_FAIL_MODE = 0x0141; - static const PID DMX_STARTUP_MODE = 0x0142; - /// Category – Dimmer Settings - static const PID DIMMER_INFO = 0x0340; - static const PID MINIMUM_LEVEL = 0x0341; - static const PID MAXIMUM_LEVEL = 0x0342; - static const PID CURVE = 0x0343; - static const PID CURVE_DESCRIPTION = 0x0344; - static const PID OUTPUT_RESPONSE_TIME = 0x0345; - static const PID OUTPUT_RESPONSE_TIME_DESCRIPTION = 0x0346; - static const PID MODULATION_FREQUENCY = 0x0347; - static const PID MODULATION_FREQUENCY_DESCRIPTION = 0x0348; - /// Category – Power/Lamp Settings - static const PID BURN_IN = 0x0440; - /// Category – Configuration - static const PID LOCK_PIN = 0x0640; - static const PID LOCK_STATE = 0x0641; - static const PID LOCK_STATE_DESCRIPTION = 0x0642; - /// Category – Control - static const PID IDENTIFY_MODE = 0x1040; - static const PID PRESET_INFO = 0x1041; - static const PID PRESET_STATUS = 0x1042; - static const PID PRESET_MERGEMODE = 0x1043; - static const PID POWER_ON_SELF_TEST = 0x1044; + // Category – Power/Lamp Settings + /// \cite e137-1 3.10 Get/Set Burn-In (BURN_IN) + constexpr ParameterDescription BURN_IN = { + .pid = 0x0440, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Burn-In", + }; + + // Category – Configuration + /// \cite e137-1 3.9 Get/Set Lock PIN (LOCK_PIN) + constexpr ParameterDescription LOCK_PIN = { + .pid = 0x0640, + .pdl = { + .get_response = 2, + .set = 4, + }, + .command_class = CC_GET_SET, + .description = "Lock PIN", + }; + /// \cite e137-1 3.7 Get/Set Lock State (LOCK_STATE) + constexpr ParameterDescription LOCK_STATE = { + .pid = 0x0641, + .pdl = { + .get_response = 2, + .set = 3, + }, + .command_class = CC_GET_SET, + .description = "Lock State", + }; + /// \cite e137-1 3.8 Get Lock State Description (LOCK_STATE_DESCRIPTION) + constexpr ParameterDescription LOCK_STATE_DESCRIPTION = { + .pid = 0x0642, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET, + .description = "Lock State Description", + }; + + // Category – Control + /// \cite e137-1 3.2 Get/Set Identify Mode (IDENTIFY_MODE) + constexpr ParameterDescription IDENTIFY_MODE = { + .pid = 0x1040, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Identify Mode", + }; + /// \cite e137-1 5.2 Get Preset Info (PRESET_INFO) + constexpr ParameterDescription PRESET_INFO = { + .pid = 0x1041, + .pdl = { + .get_response = 0x20, + }, + .command_class = CC_GET, + .description = "Preset Info", + }; + /// \cite e137-1 5.3 Get/Set Preset Status (PRESET_STATUS) + constexpr ParameterDescription PRESET_STATUS = { + .pid = 0x1042, + .pdl = { + .get = 2, + .get_response = 9, + .set = 9, + }, + .command_class = CC_GET_SET, + .description = "Preset Status", + }; + /// \cite e137-1 5.4 Get/Set Preset Merge Mode (PRESET_MERGEMODE) + constexpr ParameterDescription PRESET_MERGEMODE = { + .pid = 0x1043, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Preset Merge Mode", + }; + /// \cite e137-1 3.6 Get/Set Power-On Self Test (POWER_ON_SELF_TEST) + constexpr ParameterDescription POWER_ON_SELF_TEST = { + .pid = 0x1044, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Power-On Self Test", + }; + + /// \cite e137-1 Table A-1: RDM Parameter ID Defines + constexpr const ParameterDescription *PIDs_E137_1[] = + { + // DMX512 Setup + &DMX_BLOCK_ADDRESS, + &DMX_FAIL_MODE, + &DMX_STARTUP_MODE, + // Dimmer Settings + &DIMMER_INFO, + &MINIMUM_LEVEL, + &MAXIMUM_LEVEL, + &CURVE, + &CURVE_DESCRIPTION, + &OUTPUT_RESPONSE_TIME, + &OUTPUT_RESPONSE_TIME_DESCRIPTION, + &MODULATION_FREQUENCY, + &MODULATION_FREQUENCY_DESCRIPTION, + // Power/Lamp Settings + &BURN_IN, + // Configuration + &LOCK_PIN, + &LOCK_STATE, + &LOCK_STATE_DESCRIPTION, + // Control + &IDENTIFY_MODE, + &PRESET_INFO, + &PRESET_STATUS, + &PRESET_MERGEMODE, + &POWER_ON_SELF_TEST, + }; + + // Preset Programmed Defines - /// Preset Programmed Defines static const uint8_t PRESET_NOT_PROGRAMMED = 0x00; static const uint8_t PRESET_PROGRAMMED = 0x01; static const uint8_t PRESET_PROGRAMMED_READ_ONLY = 0x02; - /// Merge Mode Defines + + // Merge Mode Defines + static const uint8_t MERGEMODE_DEFAULT = 0x00; static const uint8_t MERGEMODE_HTP = 0x01; static const uint8_t MERGEMODE_LTP = 0x02; diff --git a/protocol/esta/rdm/E1.37-2.h b/protocol/esta/rdm/E1.37-2.h index 67eb11f..0d3a938 100644 --- a/protocol/esta/rdm/E1.37-2.h +++ b/protocol/esta/rdm/E1.37-2.h @@ -24,6 +24,7 @@ #pragma once #include +#include "parameterdescription.h" /** * \ingroup RDM @@ -32,34 +33,175 @@ * IPv4 & DNS Configuration Messages */ namespace RDM { + // Appendix A: Defined Parameters (Normative) - using PID = uint16_t; - - /// Appendix A: Defined Parameters (Normative) static const uint32_t IPV4_UNCONFIGURED = 0x00000000; static const uint32_t NO_DEFAULT_ROUTE = 0x00000000; - /// Table A-1: RDM Parameter ID - static const PID LIST_INTERFACES = 0x0700; - static const PID INTERFACE_LABEL = 0x0701; - static const PID INTERFACE_HARDWARE_ADDRESS_TYPE1 = 0x0702; - static const PID IPV4_DHCP_MODE = 0x0703; - static const PID IPV4_ZEROCONF_MODE = 0x0704; - static const PID IPV4_CURRENT_ADDRESS = 0x0705; - static const PID IPV4_STATIC_ADDRESS = 0x0706; - static const PID INTERFACE_RENEW_DHCP = 0x0707; - static const PID INTERFACE_RELEASE_DHCP = 0x0708; - static const PID INTERFACE_APPLY_CONFIGURATION = 0x0709; - static const PID IPV4_DEFAULT_ROUTE = 0x070A; - static const PID DNS_IPV4_NAME_SERVER = 0x070B; - static const PID DNS_HOSTNAME = 0x070C; - static const PID DNS_DOMAIN_NAME = 0x070D; - /// Table A-2: Additional NACK Reason Codes + // Table A-1: RDM Parameter ID + /// \cite e137-2 4.1 Get Interface List (LIST_INTERFACES) + constexpr ParameterDescription LIST_INTERFACES = { + .pid = 0x0700, + .command_class = CC_GET, + .description = "Interface List", + }; + /// \cite e137-2 4.2 Get Interface Name (INTERFACE_LABEL) + constexpr ParameterDescription INTERFACE_LABEL = { + .pid = 0x0701, + .pdl = { + .get = 4, + .get_response = 4, + }, + .command_class = CC_GET, + .description = "Interface Name", + }; + /// \cite e137-2 4.3 Get Hardware Address (INTERFACE_HARDWARE_ADDRESS_TYPE1) + constexpr ParameterDescription INTERFACE_HARDWARE_ADDRESS_TYPE1 = { + .pid = 0x0702, + .pdl = { + .get = 4, + .get_response = 0x0a, + }, + .command_class = CC_GET, + .description = "Hardware Address", + }; + /// \cite e137-2 4.4 Get/Set DHCP (IPV4_DHCP_MODE) + constexpr ParameterDescription IPV4_DHCP_MODE = { + .pid = 0x0703, + .pdl = { + .get = 4, + .get_response = 5, + .set = 5, + }, + .command_class = CC_GET_SET, + .description = "DHCP Mode", + }; + /// \cite e137-2 4.5 Get/Set Zeroconf Mode (IPV4_ZEROCONF_MODE) + constexpr ParameterDescription IPV4_ZEROCONF_MODE = { + .pid = 0x0704, + .pdl = { + .get = 4, + .get_response = 5, + .set = 5, + }, + .command_class = CC_GET_SET, + .description = "Zeroconf Mode", + }; + /// \cite e137-2 4.6 Get IPv4 Address / Netmask (IPV4_CURRENT_ADDRESS) + constexpr ParameterDescription IPV4_CURRENT_ADDRESS = { + .pid = 0x0705, + .pdl = { + .get = 4, + .get_response = 0x0a, + }, + .command_class = CC_GET, + .description = "IPv4 Address / Netmask", + }; + /// \cite e137-2 4.7 Get/Set IPv4 Static Address (IPV4_STATIC_ADDRESS) + constexpr ParameterDescription IPV4_STATIC_ADDRESS = { + .pid = 0x0706, + .pdl = { + .get = 4, + .get_response = 9, + .set = 9, + }, + .command_class = CC_GET_SET, + .description = "IPv4 Static Address", + }; + /// \cite e137-2 4.9 Renew DHCP Lease (INTERFACE_RENEW_DHCP) + constexpr ParameterDescription INTERFACE_RENEW_DHCP = { + .pid = 0x0707, + .pdl = { + .set = 4, + }, + .command_class = CC_SET, + .description = "Renew DHCP Lease", + }; + /// \cite e137-2 4.10 Release DHCP Lease (INTERFACE_RELEASE_DHCP) + constexpr ParameterDescription INTERFACE_RELEASE_DHCP = { + .pid = 0x0708, + .pdl = { + .set = 4, + }, + .command_class = CC_SET, + .description = "Release DHCP Lease", + }; + /// \cite e137-2 4.8 Apply Interface Configuration (INTERFACE_APPLY_CONFIGURATION) + constexpr ParameterDescription INTERFACE_APPLY_CONFIGURATION = { + .pid = 0x0709, + .pdl = { + .set = 4, + }, + .command_class = CC_SET, + .description = "Apply Interface Configuration", + }; + /// \cite e137-2 4.11 Get/Set Default Route (IPV4_DEFAULT_ROUTE) + constexpr ParameterDescription IPV4_DEFAULT_ROUTE = { + .pid = 0x070A, + .pdl = { + .get_response = 8, + .set = 8, + }, + .command_class = CC_GET_SET, + .description = "Default Route", + }; + /// \cite e137-2 4.12 Get/Set Name Servers (DNS_IPV4_NAME_SERVER) + constexpr ParameterDescription DNS_IPV4_NAME_SERVER = { + .pid = 0x070B, + .pdl = { + .get = 1, + .get_response = 5, + .set = 5, + }, + .command_class = CC_GET_SET, + .description = "Name Servers", + }; + /// \cite e137-2 4.13 Get/Set Host Name (DNS_HOSTNAME) + constexpr ParameterDescription DNS_HOSTNAME = { + .pid = 0x070C, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Host Name", + }; + /// \cite e137-2 4.14 Get/Set Domain Name (DNS_DOMAIN_NAME) + constexpr ParameterDescription DNS_DOMAIN_NAME = { + .pid = 0x070D, + .command_class = CC_GET_SET, + .description = "Domain Name", + }; + + /// \cite e137-2 Table A-1: RDM Parameter ID Defines + constexpr const ParameterDescription *PIDs_E137_2[] = + { + // IP & DNS Configuration + &LIST_INTERFACES, + &INTERFACE_LABEL, + &INTERFACE_HARDWARE_ADDRESS_TYPE1, + &IPV4_DHCP_MODE, + &IPV4_ZEROCONF_MODE, + &IPV4_CURRENT_ADDRESS, + &IPV4_STATIC_ADDRESS, + &INTERFACE_RENEW_DHCP, + &INTERFACE_RELEASE_DHCP, + &INTERFACE_APPLY_CONFIGURATION, + &IPV4_DEFAULT_ROUTE, + &DNS_IPV4_NAME_SERVER, + &DNS_HOSTNAME, + &DNS_DOMAIN_NAME, + }; + + + // Table A-2: Additional NACK Reason Codes // superseded in E1.37-7 // static const uint16_t NR_ACTION_NOT_SUPPORTED = 0x000B; //!< The parameter data is valid but the SET operation cannot be performed with the current configuration. - /// Table A-3: DHCP Mode + + // Table A-3: DHCP Mode + static const uint8_t DHCP_STATUS_INACTIVE = 0x00; static const uint8_t DHCP_STATUS_ACTIVE = 0x01; //!< The IP address was not obtained via DHCP. static const uint8_t DHCP_STATUS_UNKNOWN = 0x02; //!< The IP address was obtained via DHCP. diff --git a/protocol/esta/rdm/E1.37-7.h b/protocol/esta/rdm/E1.37-7.h index f35ce1e..7104798 100644 --- a/protocol/esta/rdm/E1.37-7.h +++ b/protocol/esta/rdm/E1.37-7.h @@ -24,6 +24,7 @@ #pragma once #include +#include "parameterdescription.h" /** * \ingroup RDM @@ -32,48 +33,236 @@ * Gateway & Splitter Configuration Messages */ namespace RDM { - using PID = uint16_t; + // Appendix A: Defined Parameters (Normative) - /// Appendix A: Defined Parameters (Normative) + // Table A-1: RDM Parameter ID + /// \cite e137-7 6.1 Get Endpoint List (ENDPOINT_LIST) + constexpr ParameterDescription ENDPOINT_LIST = { + .pid = 0x0900, + .pdl = { + .get_response = 7, + }, + .command_class = CC_GET, + .description = "Endpoint List", + }; + /// \cite e137-7 6.2 Get Endpoint List Change (ENDPOINT_LIST_CHANGE) + constexpr ParameterDescription ENDPOINT_LIST_CHANGE = { + .pid = 0x0901, + .pdl = { + .get_response = 4, + }, + .command_class = CC_GET, + .description = "Endpoint List Change", + }; + /// \cite e137-7 6.3 Get/Set Identify Endpoint (IDENTIFY_ENDPOINT) + constexpr ParameterDescription IDENTIFY_ENDPOINT = { + .pid = 0x0902, + .pdl = { + .get = 2, + .get_response = 3, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Identify Endpoint", + }; + /// \cite e137-7 6.4 Get/Set Endpoint to Universe (ENDPOINT_TO_UNIVERSE) + constexpr ParameterDescription ENDPOINT_TO_UNIVERSE = { + .pid = 0x0903, + .pdl = { + .get = 2, + .get_response = 4, + .set = 4, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Endpoint to Universe", + }; + /// \cite e137-7 6.5 Get/Set Endpoint Mode (ENDPOINT_MODE) + constexpr ParameterDescription ENDPOINT_MODE = { + .pid = 0x0904, + .pdl = { + .get = 2, + .get_response = 3, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Endpoint Mode", + }; + /// \cite e137-7 6.6 Get/Set Endpoint Label (ENDPOINT_LABEL) + constexpr ParameterDescription ENDPOINT_LABEL = { + .pid = 0x0905, + .pdl = { + .get = 2, + .get_response = 2, + .set = 2, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Endpoint Label", + }; + /// \cite e137-7 6.7 Get/Set Enable RDM Traffic on Endpoint (RDM_TRAFFIC_ENABLE) + constexpr ParameterDescription RDM_TRAFFIC_ENABLE = { + .pid = 0x0906, + .pdl = { + .get = 2, + .get_response = 3, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Enable RDM Traffic on Endpoint", + }; + /// \cite e137-7 6.8 Get/Set Discovery State (DISCOVERY_STATE) + constexpr ParameterDescription DISCOVERY_STATE = { + .pid = 0x0907, + .pdl = { + .get = 2, + .get_response = 5, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Discovery State", + }; + /// \cite e137-7 6.9 Get/Set Background Discovery (BACKGROUND_DISCOVERY) + constexpr ParameterDescription BACKGROUND_DISCOVERY = { + .pid = 0x0908, + .pdl = { + .get = 2, + .get_response = 3, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Background Discovery", + }; + /// \cite e137-7 6.10 Get/Set Endpoint Timing (ENDPOINT_TIMING) + constexpr ParameterDescription ENDPOINT_TIMING = { + .pid = 0x0909, + .pdl = { + .get = 2, + .get_response = 4, + .set = 3, + .set_response = 2, + }, + .command_class = CC_GET_SET, + .description = "Endpoint Timing", + }; + /// \cite e137-7 6.11 Get Endpoint Timing Description (ENDPOINT_TIMING_DESCRIPTION) + constexpr ParameterDescription ENDPOINT_TIMING_DESCRIPTION = { + .pid = 0x090A, + .pdl = { + .get = 1, + .get_response = 1, + }, + .command_class = CC_GET, + .description = "Endpoint Timing Description", + }; + /// \cite e137-7 6.12 Get Endpoint Responders (ENDPOINT_RESPONDERS) + constexpr ParameterDescription ENDPOINT_RESPONDERS = { + .pid = 0x090B, + .pdl = { + .get = 2, + .get_response = 6, + }, + .command_class = CC_GET, + .description = "Endpoint Responders", + }; + /// \cite e137-7 6.13 Get Endpoint Responder List Change (ENDPOINT_RESPONDER_LIST_CHANGE) + constexpr ParameterDescription ENDPOINT_RESPONDER_LIST_CHANGE = { + .pid = 0x090C, + .pdl = { + .get = 2, + .get_response = 6, + }, + .command_class = CC_GET, + .description = "Endpoint Responder List Change", + }; + /// \cite e137-7 6.14 Get Binding and Control Fields (BINDING_CONTROL_FIELDS) + constexpr ParameterDescription BINDING_CONTROL_FIELDS = { + .pid = 0x090D, + .pdl = { + .get = 8, + .get_response = 0x10, + }, + .command_class = CC_GET, + .description = "Binding and Control Fields", + }; + /// \cite e137-7 7.1 Get/Set Background Queued/Status Message Collection Policy + constexpr ParameterDescription BACKGROUND_QUEUED_STATUS_POLICY = { + .pid = 0x090E, + .pdl = { + .get_response = 2, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Message Collection Policy", + }; + /// \cite e137-7 7.2 Get Background Queued/Status Message Policy Description + constexpr ParameterDescription BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION = { + .pid = 0x090F, + .pdl = { + .get = 1, + .get_response = 1, + }, + .command_class = CC_GET, + .description = "Message Policy Description", + }; - /// Table A-1: RDM Parameter ID - static const PID ENDPOINT_LIST = 0x0900; - static const PID ENDPOINT_LIST_CHANGE = 0x0901; - static const PID IDENTIFY_ENDPOINT = 0x0902; - static const PID ENDPOINT_TO_UNIVERSE = 0x0903; - static const PID ENDPOINT_MODE = 0x0904; - static const PID ENDPOINT_LABEL = 0x0905; - static const PID RDM_TRAFFIC_ENABLE = 0x0906; - static const PID DISCOVERY_STATE = 0x0907; - static const PID BACKGROUND_DISCOVERY = 0x0908; - static const PID ENDPOINT_TIMING = 0x0909; - static const PID ENDPOINT_TIMING_DESCRIPTION = 0x090A; - static const PID ENDPOINT_RESPONDERS = 0x090B; - static const PID ENDPOINT_RESPONDER_LIST_CHANGE = 0x090C; - static const PID BINDING_CONTROL_FIELDS = 0x090D; - static const PID BACKGROUND_QUEUED_STATUS_POLICY = 0x090E; - static const PID BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION = 0x090F; + /// \cite e137-7 Table A-1: RDM Parameter ID Defines + constexpr const ParameterDescription *PIDs_E137_7[] = + { + // RDMnet and RDM Splitter Management + &ENDPOINT_LIST, + &ENDPOINT_LIST_CHANGE, + &IDENTIFY_ENDPOINT, + &ENDPOINT_TO_UNIVERSE, + &ENDPOINT_MODE, + &ENDPOINT_LABEL, + &RDM_TRAFFIC_ENABLE, + &DISCOVERY_STATE, + &BACKGROUND_DISCOVERY, + &ENDPOINT_TIMING, + &ENDPOINT_TIMING_DESCRIPTION, + &ENDPOINT_RESPONDERS, + &ENDPOINT_RESPONDER_LIST_CHANGE, + &BINDING_CONTROL_FIELDS, + &BACKGROUND_QUEUED_STATUS_POLICY, + &BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION, + }; + + + // Table A-2: Discovery State - /// Table A-2: Discovery State static const uint8_t DISCOVERY_INCOMPLETE = 0x00; static const uint8_t DISCOVERY_INCREMENTAL = 0x01; static const uint8_t DISCOVERY_FULL = 0x02; static const uint8_t DISCOVERY_NOT_ACTIVE = 0x04; - /// Table A-3: Discovery Status + + // Table A-3: Discovery Status + static const uint16_t DISCOVERY_COUNT_INCOMPLETE = 0x0000; static const uint16_t DISCOVERY_COUNT_UNKNOWN = 0xFFFF; - /// Table A-4: Endpoint Mode + + // Table A-4: Endpoint Mode + static const uint8_t ENDPOINT_MODE_DISABLED = 0x00; static const uint8_t ENDPOINT_MODE_INPUT = 0x01; static const uint8_t ENDPOINT_MODE_OUTPUT = 0x02; - /// Table A-5: Endpoint Types + + // Table A-5: Endpoint Types + static const uint8_t ENDPOINT_TYPE_VIRTUAL = 0x00; static const uint8_t ENDPOINT_TYPE_PHYSICAL = 0x01; - /// Table A-6: Additional Response NACK Reason Codes + + // Table A-6: Additional Response NACK Reason Codes + static const uint16_t NR_ACTION_NOT_SUPPORTED = 0x000B; // also defined in E1.37-2 static const uint16_t NR_ENDPOINT_NUMBER_INVALID = 0x000C; static const uint16_t NR_INVALID_ENDPOINT_MODE = 0x000D; diff --git a/protocol/esta/rdm/message.cpp b/protocol/esta/rdm/message.cpp index 635b1f8..4c95d7a 100644 --- a/protocol/esta/rdm/message.cpp +++ b/protocol/esta/rdm/message.cpp @@ -170,7 +170,7 @@ void Message::read(const std::vector &buffer) void Message::write(std::vector &buffer) const { if (mdb.cc == DISCOVERY_COMMAND_RESPONSE && - mdb.pid == DISC_UNIQUE_BRANCH) + mdb.pid == DISC_UNIQUE_BRANCH.pid) return writeDiscBranch(buffer); buffer.reserve(buffer.size() + 26 + mdb.pdl()); // pre-allocate necessary memory @@ -205,7 +205,7 @@ void Message::write(std::vector &buffer) const void Message::writeDiscBranch(std::vector &buffer) const { if (mdb.cc != DISCOVERY_COMMAND_RESPONSE || - mdb.pid != DISC_UNIQUE_BRANCH) + mdb.pid != DISC_UNIQUE_BRANCH.pid) return write(buffer); buffer.reserve(buffer.size() + 24); // pre-allocate necessary memory diff --git a/protocol/esta/rdm/parameter.cpp b/protocol/esta/rdm/parameter.cpp index c50b17c..60dfa40 100644 --- a/protocol/esta/rdm/parameter.cpp +++ b/protocol/esta/rdm/parameter.cpp @@ -22,104 +22,144 @@ SOFTWARE. */ #include "parameter.h" +#include "E1.37-7.h" namespace RDM { /** * @brief Parameter::Parameter - * @param id + * @param metadata */ -Parameter::Parameter(const PID id) - : id(id) +Parameter::Parameter(const ParameterDescription metadata) + : info(metadata) + , action_discover_(nullptr) + , action_get_(nullptr) + , action_set_(nullptr) + , action_discover_response_(nullptr) + , action_get_response_(nullptr) + , action_set_response_(nullptr) { } /** - * @brief Parameter::~Parameter + * @brief Parameter::isManufacturer + * @return */ -Parameter::~Parameter() +bool Parameter::isManufacturer() const { + return info.pid >= 0x8000 && info.pid <= 0xFFDF; // \cite RDM 10.4.2 range } /** * @brief Parameter::disc - * @param message - * @param response + * @param msg */ -void Parameter::disc(const MsgPtr message, MsgPtr response) const +void Parameter::dispatch(MsgPair msg) const { - if (!discover_) - { - response->nak(NR_UNSUPPORTED_COMMAND_CLASS); - return; - } + auto exec = [this, &msg] (PidAction action, uint8_t min_pdl, uint8_t cc) + { + auto [command, response] = msg; + if (action) + if (command->mdb.pdl() < min_pdl) + return response->nak(NR_FORMAT_ERROR); + else + return action(msg); + else + if (info.command_class & cc) + return response->nak(NR_ACTION_NOT_SUPPORTED); + else + return response->nak(NR_UNSUPPORTED_COMMAND_CLASS); + }; - discover_(message, response); + switch (msg.first->mdb.cc) { + case DISCOVERY_COMMAND: + exec(action_discover_, info.pdl.get, CC_DISC); + break; + case DISCOVERY_COMMAND_RESPONSE: + exec(action_discover_response_, info.pdl.get_response, CC_DISC); + break; + case GET_COMMAND: + exec(action_get_, info.pdl.get, CC_GET); + break; + case GET_COMMAND_RESPONSE: + exec(action_get_response_, info.pdl.get_response, CC_GET); + break; + case SET_COMMAND: + exec(action_set_, info.pdl.set, CC_SET); + break; + case SET_COMMAND_RESPONSE: + exec(action_set_response_, info.pdl.set_response, CC_SET); + break; + default: + break; + } } /** - * @brief Parameter::get - * @param message - * @param response - */ -void Parameter::get(const MsgPtr message, MsgPtr response) const -{ - if (!getter_){ - response->nak(NR_UNSUPPORTED_COMMAND_CLASS); - return; - } - - getter_(message, response); -} - - -/** - * @brief Parameter::set - * @param message - * @param response - */ -void Parameter::set(const MsgPtr message, MsgPtr response) const -{ - if (!setter_) - { - response->nak(NR_UNSUPPORTED_COMMAND_CLASS); - return; - } - - setter_(message, response); -} - - -/** - * @brief Parameter::discAction + * @brief Parameter::onDisc * @param action */ -void Parameter::discAction(const PidAction action) +void Parameter::onDisc(const PidAction action) { - discover_ = action; + if (info.command_class & CC_DISC) + action_discover_ = action; }; /** - * @brief Parameter::getAction + * @brief Parameter::onDiscResponse * @param action */ -void Parameter::getAction(const PidAction action) +void Parameter::onDiscResponse(const PidAction action) { - getter_ = action; + if (info.command_class & CC_DISC) + action_discover_response_ = action; }; /** - * @brief Parameter::setAction + * @brief Parameter::onGet * @param action */ -void Parameter::setAction(const PidAction action) +void Parameter::onGet(const PidAction action) { - setter_ = action; + if (info.command_class & CC_GET) + action_get_ = action; }; + +/** + * @brief Parameter::onGetResponse + * @param action + */ +void Parameter::onGetResponse(const PidAction action) +{ + if (info.command_class & CC_GET) + action_get_response_ = action; +}; + + +/** + * @brief Parameter::onSet + * @param action + */ +void Parameter::onSet(const PidAction action) +{ + if (info.command_class & CC_SET) + action_set_ = action; +}; + + +/** + * @brief Parameter::onSetResponse + * @param action + */ +void Parameter::onSetResponse(const PidAction action) +{ + if (info.command_class & CC_SET) + action_set_response_ = action; +}; } // namespace RDM diff --git a/protocol/esta/rdm/parameter.h b/protocol/esta/rdm/parameter.h index b6f680a..84c7571 100644 --- a/protocol/esta/rdm/parameter.h +++ b/protocol/esta/rdm/parameter.h @@ -24,18 +24,13 @@ #pragma once #include "message.h" -#include "rdm.h" +#include "parameterdescription.h" #include namespace RDM { - -/** - * @brief function that acts upon a PID - */ -using PidAction = std::function; - +using PidAction = std::function; //!< Function that performs action on a Message. /** * @brief The Parameter class @@ -43,24 +38,33 @@ using PidAction = std::function; class Parameter { public: - explicit Parameter(const PID id); - virtual ~Parameter(); + explicit Parameter(const ParameterDescription metadata); - const PID id; //!< Parameter ID + const ParameterDescription info; //!< Parameter ID + bool isManufacturer() const; - void disc(const MsgPtr message, MsgPtr response) const; - void get(const MsgPtr message, MsgPtr response) const; - void set(const MsgPtr message, MsgPtr response) const; + void dispatch(MsgPair msg) const; - void discAction(const PidAction action); - void getAction(const PidAction action); - void setAction(const PidAction action); + // responder behavior + void onDisc(const PidAction action); + void onGet(const PidAction action); + void onSet(const PidAction action); + + // controller behavior + void onDiscResponse(const PidAction action); + void onGetResponse(const PidAction action); + void onSetResponse(const PidAction action); private: - PidAction discover_; - PidAction getter_; - PidAction setter_; + // responder actions + PidAction action_discover_; + PidAction action_get_; + PidAction action_set_; + + // controller actions + PidAction action_discover_response_; + PidAction action_get_response_; + PidAction action_set_response_; }; - } // namespace RDM diff --git a/protocol/esta/rdm/rdm.cpp b/protocol/esta/rdm/rdm.cpp index dc21bf2..b0026dd 100644 --- a/protocol/esta/rdm/rdm.cpp +++ b/protocol/esta/rdm/rdm.cpp @@ -23,6 +23,9 @@ */ #include "rdm.h" +#include "E1.37-1.h" +#include "E1.37-2.h" +#include "E1.37-7.h" namespace RDM { @@ -466,4 +469,31 @@ std::string StatusMessageDescription(uint16_t status) } } + +/** + * @brief StandardDescription + * @param pid + * @return + */ +const ParameterDescription StandardDescription(const PID pid) +{ + for (const auto &description : PIDs) + if (description->pid == pid) + return *description; + + for (const auto &description : PIDs_E137_1) + if (description->pid == pid) + return *description; + + for (const auto &description : PIDs_E137_2) + if (description->pid == pid) + return *description; + + for (const auto &description : PIDs_E137_7) + if (description->pid == pid) + return *description; + + return ParameterDescription(); +} + } // namespace RDM diff --git a/protocol/esta/rdm/rdm.h b/protocol/esta/rdm/rdm.h index e60a81d..3bfa458 100644 --- a/protocol/esta/rdm/rdm.h +++ b/protocol/esta/rdm/rdm.h @@ -23,10 +23,7 @@ */ #pragma once -#include "E1.37-1.h" -#include "E1.37-2.h" -#include "E1.37-7.h" - +#include "dmx.h" #include "parameterdescription.h" #include @@ -75,70 +72,6 @@ namespace RDM { static const uint8_t RESPONSE_TYPE_NACK_REASON = 0x02; //!< See Table A-17 static const uint8_t RESPONSE_TYPE_ACK_OVERFLOW = 0x03; //!< Additional Response Data available beyond single response length. - /// Table A-3: RDM Categories/Parameter ID Defines - /// Category – Network Management - static const PID DISC_UNIQUE_BRANCH = 0x0001; - static const PID DISC_MUTE = 0x0002; - static const PID DISC_UN_MUTE = 0x0003; - static const PID PROXIED_DEVICES = 0x0010; - static const PID PROXIED_DEVICE_COUNT = 0x0011; - static const PID COMMS_STATUS = 0x0015; - /// Category - Status Collection - static const PID QUEUED_MESSAGE = 0x0020; // See Table A-4 - static const PID STATUS_MESSAGES = 0x0030; // See Table A-4 - static const PID STATUS_ID_DESCRIPTION = 0x0031; - static const PID CLEAR_STATUS_ID = 0x0032; - static const PID SUB_DEVICE_STATUS_REPORT_THRESHOLD = 0x0033; // See Table A-4 - /// Category - RDM Information - static const PID SUPPORTED_PARAMETERS = 0x0050; - static const PID PARAMETER_DESCRIPTION = 0x0051; - /// Category – Product Information - static const PID DEVICE_INFO = 0x0060; - static const PID PRODUCT_DETAIL_ID_LIST = 0x0070; - static const PID DEVICE_MODEL_DESCRIPTION = 0x0080; - static const PID MANUFACTURER_LABEL = 0x0081; - static const PID DEVICE_LABEL = 0x0082; - static const PID FACTORY_DEFAULTS = 0x0090; - static const PID LANGUAGE_CAPABILITIES = 0x00A0; - static const PID LANGUAGE = 0x00B0; - static const PID SOFTWARE_VERSION_LABEL = 0x00C0; - static const PID BOOT_SOFTWARE_VERSION_ID = 0x00C1; - static const PID BOOT_SOFTWARE_VERSION_LABEL = 0x00C2; - /// Category - DMX512 Setup - static const PID DMX_PERSONALITY = 0x00E0; - static const PID DMX_PERSONALITY_DESCRIPTION = 0x00E1; - static const PID DMX_START_ADDRESS = 0x00F0; - static const PID SLOT_INFO = 0x0120; - static const PID SLOT_DESCRIPTION = 0x0121; - static const PID DEFAULT_SLOT_VALUE = 0x0122; - /// Category – Sensors - static const PID SENSOR_DEFINITION = 0x0200; - static const PID SENSOR_VALUE = 0x0201; - static const PID RECORD_SENSORS = 0x0202; - /// Category – Power/Lamp Settings - static const PID DEVICE_HOURS = 0x0400; - static const PID LAMP_HOURS = 0x0401; - static const PID LAMP_STRIKES = 0x0402; - static const PID LAMP_STATE = 0x0403; - static const PID LAMP_ON_MODE = 0x0404; - static const PID DEVICE_POWER_CYCLES = 0x0405; - /// Category - Display Settings - static const PID DISPLAY_INVERT = 0x0500; - static const PID DISPLAY_LEVEL = 0x0501; - /// Category – Configuration - static const PID PAN_INVERT = 0x0600; - static const PID TILT_INVERT = 0x0601; - static const PID PAN_TILT_SWAP = 0x0602; - static const PID REAL_TIME_CLOCK = 0x0603; - /// Category – Control - static const PID IDENTIFY_DEVICE = 0x1000; - static const PID RESET_DEVICE = 0x1001; - static const PID POWER_STATE = 0x1010; - static const PID PERFORM_SELFTEST = 0x1020; - static const PID SELF_TEST_DESCRIPTION = 0x1021; - static const PID CAPTURE_PRESET = 0x1030; - static const PID PRESET_PLAYBACK = 0x1031; - // Table A-4: Status Type Defines static const uint8_t STATUS_NONE = 0x00; //!< Not allowed for use with GET: QUEUED_MESSAGE @@ -150,6 +83,578 @@ namespace RDM { static const uint8_t STATUS_WARNING_CLEARED = 0x13; static const uint8_t STATUS_ERROR_CLEARED = 0x14; + + // Table A-3: RDM Categories/Parameter ID Defines + const ParameterDescription StandardDescription(const PID pid); + // Category – Network Management + /// \cite RDM 7.5 Discovery Unique Branch Message (DISC_UNIQUE_BRANCH) + constexpr ParameterDescription DISC_UNIQUE_BRANCH = { + .pid = 0x0001, + .pdl = { + .get = 12, + }, + .command_class = CC_DISC, + .description = "Discovery Unique Branch", + }; + /// \cite RDM 7.6.3 Discovery Mute Message (DISC_MUTE) + constexpr ParameterDescription DISC_MUTE = { + .pid = 0x0002, + .pdl = { + .get_response = 2, + }, + .command_class = CC_DISC, + .description = "Discovery Mute", + }; + /// \cite RDM 7.6.4 Discovery Un-Mute Message (DISC_UN_MUTE) + constexpr ParameterDescription DISC_UN_MUTE = { + .pid = 0x0003, + .pdl = { + .get_response = 2, + }, + .command_class = CC_DISC, + .description = "Discovery Un-Mute", + }; + /// \cite RDM 8.4.2 Get Proxied Devices (PROXIED_DEVICES) + constexpr ParameterDescription PROXIED_DEVICES = { + .pid = 0x0010, + .command_class = CC_GET, + .description = "Proxied Devices", + }; + /// \cite RDM 8.4.1 Get Proxied Device Count (PROXIED_DEVICE_COUNT) + constexpr ParameterDescription PROXIED_DEVICE_COUNT = { + .pid = 0x0011, + .pdl = { + .get_response = 2, + }, + .command_class = CC_GET, + .description = "Proxied Device Count", + }; + /// \cite RDM 10.2.1 Communication Status (COMMS_STATUS) + constexpr ParameterDescription COMMS_STATUS = { + .pid = 0x0015, + .pdl = { + .get_response = 6, + }, + .command_class = CC_GET_SET, + .description = "Communication Status", + }; + + + // Category - Status Collection + /// \cite RDM 10.3.1 Get Queued Message (QUEUED_MESSAGE) + constexpr ParameterDescription QUEUED_MESSAGE = { + .pid = 0x0020, + .pdl = { + .get = 1, + }, + .command_class = CC_GET, + .description = "Queued Message", + }; // See Table A-4 + /// \cite RDM 10.3.2 Get Status Messages (STATUS_MESSAGES) + constexpr ParameterDescription STATUS_MESSAGES = { + .pid = 0x0030, + .pdl = { + .get = 1, + }, + .command_class = CC_GET, + .description = "Status Messages", + }; // See Table A-4 + /// \cite RDM 10.3.3 Get Status ID Description (STATUS_ID_DESCRIPTION) + constexpr ParameterDescription STATUS_ID_DESCRIPTION = { + .pid = 0x0031, + .pdl = { + .get = 2, + }, + .command_class = CC_GET, + .description = "Status ID Description", + }; + /// \cite RDM 10.3.4 Clear Status ID (CLEAR_STATUS_ID) + constexpr ParameterDescription CLEAR_STATUS_ID = { + .pid = 0x0032, + .command_class = CC_SET, + .description = "Clear Status ID", + }; + /// \cite RDM 10.3.5 Get/Set Sub-Device Status Reporting Threshold + constexpr ParameterDescription SUB_DEVICE_STATUS_REPORT_THRESHOLD = { + .pid = 0x0033, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Sub-Device Reporting Threshold", + }; // See Table A-4 + + + // Category - RDM Information + /// \cite RDM 10.4.1 Get Supported Parameters (SUPPORTED_PARAMETERS) + constexpr ParameterDescription SUPPORTED_PARAMETERS = { + .pid = 0x0050, + .command_class = CC_GET, + .description = "Supported Parameters", + }; + /// \cite RDM 10.4.2 Get Parameter Description (PARAMETER_DESCRIPTION) + constexpr ParameterDescription PARAMETER_DESCRIPTION = { + .pid = 0x0051, + .pdl = { + .get = 2, + .get_response = 20, // + optional description + }, + .command_class = CC_GET, + .description = "Parameter Description", + }; + + + // Category – Product Information + + /// \cite RDM 10.5.1 Get Device Info (DEVICE_INFO) + constexpr ParameterDescription DEVICE_INFO = { + .pid = 0x0060, + .pdl = { + .get_response = 19, + }, + .command_class = CC_GET, + .description = "Device Info", + }; + /// \cite RDM 10.5.2 Get Product Detail ID List (PRODUCT_DETAIL_ID_LIST) + constexpr ParameterDescription PRODUCT_DETAIL_ID_LIST = { + .pid = 0x0070, + .command_class = CC_GET, + .description = "Product Detail ID List", + }; + /// \cite RDM 10.5.3 Get Device Model Description (DEVICE_MODEL_DESCRIPTION) + constexpr ParameterDescription DEVICE_MODEL_DESCRIPTION = { + .pid = 0x0080, + .command_class = CC_GET, + .description = "Device Model Description", + }; + /// \cite RDM 10.5.4 Get Manufacturer Label (MANUFACTURER_LABEL) + constexpr ParameterDescription MANUFACTURER_LABEL = { + .pid = 0x0081, + .command_class = CC_GET, + .description = "Manufacturer Label", + }; + /// \cite RDM 10.5.5 Get/Set Device Label (DEVICE_LABEL) + constexpr ParameterDescription DEVICE_LABEL = { + .pid = 0x0082, + .command_class = CC_GET_SET, + .description = "Device Label", + }; + /// \cite RDM 10.5.6 Get/Set Factory Defaults (FACTORY_DEFAULTS) + constexpr ParameterDescription FACTORY_DEFAULTS = { + .pid = 0x0090, + .pdl = { + .get_response = 1, + }, + .command_class = CC_GET_SET, + .description = "Factory Defaults", + }; + /// \cite RDM 10.5.7 Get Language Capabilities (LANGUAGE_CAPABILITIES) + constexpr ParameterDescription LANGUAGE_CAPABILITIES = { + .pid = 0x00A0, + .command_class = CC_GET, + .description = "Language Capabilities", + }; + /// \cite RDM 10.5.8 Get/Set Language (LANGUAGE) + constexpr ParameterDescription LANGUAGE = { + .pid = 0x00B0, + .pdl = { + .get_response = 2, + .set = 2, + }, + .command_class = CC_GET_SET, + .description = "Language", + }; + /// \cite RDM 10.5.9 Get Software Version Label (SOFTWARE_VERSION_LABEL) + constexpr ParameterDescription SOFTWARE_VERSION_LABEL = { + .pid = 0x00C0, + .command_class = CC_GET, + .description = "Software Version Label", + }; + /// \cite RDM 10.5.10 Get Boot Software Version ID (BOOT_SOFTWARE_VERSION_ID) + constexpr ParameterDescription BOOT_SOFTWARE_VERSION_ID = { + .pid = 0x00C1, + .pdl = { + .get_response = 4, + }, + .command_class = CC_GET, + .description = "Boot Software Version ID", + }; + /// \cite RDM 10.5.11 Get Boot Software Version Label (BOOT_SOFTWARE_VERSION_LABEL) + constexpr ParameterDescription BOOT_SOFTWARE_VERSION_LABEL = { + .pid = 0x00C2, + .command_class = CC_GET, + .description = "Boot Software Version Label", + }; + + + // Category - DMX512 Setup + + /// \cite RDM 10.6.1 Get/Set DMX512 Personality (DMX_PERSONALITY) + constexpr ParameterDescription DMX_PERSONALITY = { + .pid = 0x00E0, + .pdl = { + .get_response = 2, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "DMX512 Personality", + }; + /// \cite RDM 10.6.2 Get DMX512 Personality Description (DMX_PERSONALITY_DESCRIPTION) + constexpr ParameterDescription DMX_PERSONALITY_DESCRIPTION = { + .pid = 0x00E1, + .pdl = { + .get = 1, + .get_response = 3, + }, + .command_class = CC_GET, + .description = "DMX512 Personality Description", + }; + /// \cite RDM 10.6.3 Get/Set DMX512 Starting Address (DMX_START_ADDRESS) + constexpr ParameterDescription DMX_START_ADDRESS = { + .pid = 0x00F0, + .pdl = { + .get_response = 2, + .set = 2, + }, + .command_class = CC_GET_SET, + .maximum_value = DMX::E111_LAST_SLOT, + .description = "DMX512 Starting Address", + }; + /// \cite RDM 10.6.4 Get Slot Info (SLOT_INFO) + constexpr ParameterDescription SLOT_INFO = { + .pid = 0x0120, + .command_class = CC_GET, + .description = "Slot Info", + }; + /// \cite RDM 10.6.5 Get Slot Description (SLOT_DESCRIPTION) + constexpr ParameterDescription SLOT_DESCRIPTION = { + .pid = 0x0121, + .pdl = { + .get = 2, + .get_response = 2, + }, + .command_class = CC_GET, + .description = "Slot Description", + }; + /// \cite RDM 10.6.6 Get Default Slot Value (DEFAULT_SLOT_VALUE) + constexpr ParameterDescription DEFAULT_SLOT_VALUE = { + .pid = 0x0122, + .pdl = { + .get = 1, + .get_response = 13, + }, + .command_class = CC_GET, + .description = "Default Slot Value", + }; + + + // Category – Sensors + + /// \cite RDM 10.7.1 Get Sensor Definition (SENSOR_DEFINITION) + constexpr ParameterDescription SENSOR_DEFINITION { + .pid = 0x0200, + .pdl = { + .get = 1, + .get_response = 13, + }, + .command_class = CC_GET, + .description = "Sensor Definition", + }; + /// \cite RDM 10.7.2 Get/Set Sensor (SENSOR_VALUE) + constexpr ParameterDescription SENSOR_VALUE = { + .pid = 0x0201, + .pdl = { + .get = 1, + .get_response = 9, + .set = 1, + .set_response = 9, + }, + .command_class = CC_GET_SET, + .description = "Sensor Value", + }; + /// \cite RDM 10.7.3 Record Sensors (RECORD_SENSORS) + constexpr ParameterDescription RECORD_SENSORS = { + .pid = 0x0202, + .pdl = { + .set = 1, + }, + .command_class = CC_SET, + .description = "Record Sensors", + }; + + + // Category – Power/Lamp Settings + + /// \cite RDM 10.8.1 Get/Set Device Hours (DEVICE_HOURS) + constexpr ParameterDescription DEVICE_HOURS = { + .pid = 0x0400, + .pdl = { + .get_response = 4, + .set = 4, + }, + .command_class = CC_GET_SET, + .description = "Device Hours", + }; + /// \cite RDM 10.8.2 Get/Set Lamp Hours (LAMP_HOURS) + constexpr ParameterDescription LAMP_HOURS = { + .pid = 0x0401, + .pdl = { + .get_response = 4, + .set = 4, + }, + .command_class = CC_GET_SET, + .description = "Lamp Hours", + }; + /// \cite RDM 10.8.3 Get/Set Lamp Strikes (LAMP_STRIKES) + constexpr ParameterDescription LAMP_STRIKES = { + .pid = 0x0402, + .pdl = { + .get_response = 4, + .set = 4, + }, + .command_class = CC_GET_SET, + .description = "Lamp Strikes", + }; + /// \cite RDM 10.8.4 Get/Set Lamp State (LAMP_STATE) + constexpr ParameterDescription LAMP_STATE = { + .pid = 0x0403, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Lamp State", + }; + /// \cite RDM 10.8.5 Get/Set Lamp On Mode (LAMP_ON_MODE) + constexpr ParameterDescription LAMP_ON_MODE = { + .pid = 0x0404, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Lamp On Mode", + }; + /// \cite RDM 10.8.6 Get/Set Device Power Cycles (DEVICE_POWER_CYCLES) + constexpr ParameterDescription DEVICE_POWER_CYCLES = { + .pid = 0x0405, + .pdl = { + .get_response = 4, + .set = 4, + }, + .command_class = CC_GET_SET, + .description = "Device Power Cycles", + }; + + + // Category - Display Settings + + /// \cite RDM 10.9.1 Get/Set Display Invert (DISPLAY_INVERT) + constexpr ParameterDescription DISPLAY_INVERT = { + .pid = 0x0500, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Display Invert", + }; + /// \cite RDM 10.9.2 Get/Set Display Level (DISPLAY_LEVEL) + constexpr ParameterDescription DISPLAY_LEVEL = { + .pid = 0x0501, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Display Level", + }; + + + // Category – Configuration + + /// \cite RDM 10.10.1 Get/Set Pan Invert (PAN_INVERT) + constexpr ParameterDescription PAN_INVERT = { + .pid = 0x0600, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Pan Invert", + }; + /// \cite RDM 10.10.2 Get/Set Tilt Invert (TILT_INVERT) + constexpr ParameterDescription TILT_INVERT = { + .pid = 0x0601, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Tilt Invert", + }; + /// \cite RDM 10.10.3 Get/Set Pan/Tilt Swap (PAN_TILT_SWAP) + constexpr ParameterDescription PAN_TILT_SWAP = { + .pid = 0x0602, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Pan/Tilt Swap", + }; + /// \cite RDM 10.10.4 Get/Set Device Real-Time Clock (REAL_TIME_CLOCK) + constexpr ParameterDescription REAL_TIME_CLOCK = { + .pid = 0x0603, + .pdl = { + .get_response = 7, + .set = 7, + }, + .command_class = CC_GET_SET, + .description = "Device Real-Time Clock", + }; + + + // Category – Control + + /// \cite RDM 10.11.1 Get/Set Identify Device (IDENTIFY_DEVICE) + constexpr ParameterDescription IDENTIFY_DEVICE = { + .pid = 0x1000, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Identify Device", + }; + /// \cite RDM 10.11.2 Reset Device (RESET_DEVICE) + constexpr ParameterDescription RESET_DEVICE = { + .pid = 0x1001, + .pdl = { + .set = 1, + }, + .command_class = CC_SET, + .description = "Reset Device", + }; + /// \cite RDM 10.11.3 Get/Set Power State (POWER_STATE) + constexpr ParameterDescription POWER_STATE = { + .pid = 0x1010, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Get/Set Power State", + }; + /// \cite RDM 10.11.4 Get/Set Perform Self Test (PERFORM_SELFTEST) + constexpr ParameterDescription PERFORM_SELFTEST = { + .pid = 0x1020, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET_SET, + .description = "Get/Set Perform Self Test", + }; + /// \cite RDM 10.11.5 Get Self Test Description (SELF_TEST_DESCRIPTION) + constexpr ParameterDescription SELF_TEST_DESCRIPTION = { + .pid = 0x1021, + .pdl = { + .get_response = 1, + .set = 1, + }, + .command_class = CC_GET, + .description = "Get Self Test Description", + }; + /// \cite RDM 10.11.6 Capture Preset (CAPTURE_PRESET) + constexpr ParameterDescription CAPTURE_PRESET = { + .pid = 0x1030, + .pdl = { + .set = 1, + }, + .command_class = CC_SET, + .description = "Capture Preset", + }; + /// \cite RDM 10.11.7 Get/Set Preset Playback (PRESET_PLAYBACK) + constexpr ParameterDescription PRESET_PLAYBACK = { + .pid = 0x1031, + .pdl = { + .get_response = 3, + .set = 3, + }, + .command_class = CC_GET_SET, + .description = "Preset Playback", + }; + + /// \cite RDM Table A-3: RDM Categories/Parameter ID Defines + constexpr const ParameterDescription *PIDs[] = + { + // Network Management + &DISC_UNIQUE_BRANCH, + &DISC_MUTE, + &DISC_UN_MUTE, + &PROXIED_DEVICES, + &PROXIED_DEVICE_COUNT, + &COMMS_STATUS, + // Status Collection + &QUEUED_MESSAGE, + &STATUS_MESSAGES, + &STATUS_ID_DESCRIPTION, + &CLEAR_STATUS_ID, + &SUB_DEVICE_STATUS_REPORT_THRESHOLD, + // RDM Information + &SUPPORTED_PARAMETERS, + &PARAMETER_DESCRIPTION, + // Product Information + &DEVICE_INFO, + &PRODUCT_DETAIL_ID_LIST, + &DEVICE_MODEL_DESCRIPTION, + &MANUFACTURER_LABEL, + &DEVICE_LABEL, + &FACTORY_DEFAULTS, + &LANGUAGE_CAPABILITIES, + &LANGUAGE, + &SOFTWARE_VERSION_LABEL, + &BOOT_SOFTWARE_VERSION_ID, + &BOOT_SOFTWARE_VERSION_LABEL, + // DMX512 Setup + &DMX_PERSONALITY, + &DMX_PERSONALITY_DESCRIPTION, + &DMX_START_ADDRESS, + &SLOT_INFO, + &SLOT_DESCRIPTION, + &DEFAULT_SLOT_VALUE, + // Sensors + &SENSOR_DEFINITION, + &SENSOR_VALUE, + &RECORD_SENSORS, + // Power/Lamp Settings + &DEVICE_HOURS, + &LAMP_HOURS, + &LAMP_STRIKES, + &LAMP_STATE, + &LAMP_ON_MODE, + &DEVICE_POWER_CYCLES, + // Display Settings + &DISPLAY_INVERT, + &DISPLAY_LEVEL, + // Configuration + &PAN_INVERT, + &TILT_INVERT, + &PAN_TILT_SWAP, + &REAL_TIME_CLOCK, + // Control + &IDENTIFY_DEVICE, + &RESET_DEVICE, + &POWER_STATE, + &PERFORM_SELFTEST, + &SELF_TEST_DESCRIPTION, + &CAPTURE_PRESET, + &PRESET_PLAYBACK, + }; + + std::string ProductCategoryDescription(const uint16_t PRODUCT_CATEGORY); // Table A-5: Product Category Defines static const uint16_t PRODUCT_CATEGORY_NOT_DECLARED = 0x0000; diff --git a/protocol/esta/rdmnet/llrp/llrp.h b/protocol/esta/rdmnet/llrp/llrp.h index cb4e26c..1c8de63 100644 --- a/protocol/esta/rdmnet/llrp/llrp.h +++ b/protocol/esta/rdmnet/llrp/llrp.h @@ -25,6 +25,8 @@ #include "../pdu.h" #include "../rdmnet.h" +#include "E1.37-1.h" +#include "E1.37-2.h" #include "uid.h" #include "uuid.h" @@ -159,29 +161,29 @@ static const PID allowed_pids[] = { SEARCH_DOMAIN, TCP_COMMS_STATUS, BROKER_STATUS, - RDM::LIST_INTERFACES, - RDM::INTERFACE_LABEL, - RDM::INTERFACE_HARDWARE_ADDRESS_TYPE1, - RDM::IPV4_DHCP_MODE, - RDM::IPV4_ZEROCONF_MODE, - RDM::IPV4_CURRENT_ADDRESS, - RDM::IPV4_STATIC_ADDRESS, - RDM::INTERFACE_RENEW_DHCP, - RDM::INTERFACE_RELEASE_DHCP, - RDM::INTERFACE_APPLY_CONFIGURATION, - RDM::IPV4_DEFAULT_ROUTE, - RDM::DNS_IPV4_NAME_SERVER, - RDM::DNS_HOSTNAME, - RDM::DNS_DOMAIN_NAME, - RDM::DEVICE_INFO, - RDM::RESET_DEVICE, - RDM::FACTORY_DEFAULTS, - RDM::DEVICE_LABEL, - RDM::MANUFACTURER_LABEL, - RDM::DEVICE_MODEL_DESCRIPTION, - RDM::IDENTIFY_DEVICE, - RDM::LOCK_STATE_DESCRIPTION, - RDM::LOCK_STATE + RDM::LIST_INTERFACES.pid, + RDM::INTERFACE_LABEL.pid, + RDM::INTERFACE_HARDWARE_ADDRESS_TYPE1.pid, + RDM::IPV4_DHCP_MODE.pid, + RDM::IPV4_ZEROCONF_MODE.pid, + RDM::IPV4_CURRENT_ADDRESS.pid, + RDM::IPV4_STATIC_ADDRESS.pid, + RDM::INTERFACE_RENEW_DHCP.pid, + RDM::INTERFACE_RELEASE_DHCP.pid, + RDM::INTERFACE_APPLY_CONFIGURATION.pid, + RDM::IPV4_DEFAULT_ROUTE.pid, + RDM::DNS_IPV4_NAME_SERVER.pid, + RDM::DNS_HOSTNAME.pid, + RDM::DNS_DOMAIN_NAME.pid, + RDM::DEVICE_INFO.pid, + RDM::RESET_DEVICE.pid, + RDM::FACTORY_DEFAULTS.pid, + RDM::DEVICE_LABEL.pid, + RDM::MANUFACTURER_LABEL.pid, + RDM::DEVICE_MODEL_DESCRIPTION.pid, + RDM::IDENTIFY_DEVICE.pid, + RDM::LOCK_STATE_DESCRIPTION.pid, + RDM::LOCK_STATE.pid }; } // namespace COMMAND