1
0
Fork 0

structure for parameter metadata

This commit is contained in:
Kevin Matz 2023-05-02 12:49:41 -04:00
parent ec98049b39
commit 91fa0c71e4
3 changed files with 173 additions and 123 deletions

View File

@ -11,6 +11,7 @@ target_sources(${PROJECT_NAME}
device.h
message.h
parameter.h
parameterdescription.h
responder.h
sensor.h
status.h

View File

@ -0,0 +1,107 @@
#pragma once
#include <cstdint>
#include <limits>
namespace RDM {
using PID = uint16_t; //!< 16-bit number that identifies a specific type of Parameter Data
// Table A-13: Sensor Unit Defines
const uint8_t UNITS_NONE = 0x00; //!< dimentionless
const uint8_t UNITS_CENTIGRADE = 0x01; //!< termodynamic temperature
const uint8_t UNITS_VOLTS_DC = 0x02; //!< electric potential
const uint8_t UNITS_VOLTS_AC_PEAK = 0x03; //!< electric potential
const uint8_t UNITS_VOLTS_AC_RMS = 0x04; //!< electric potential
const uint8_t UNITS_AMPERE_DC = 0x05; //!< electric current
const uint8_t UNITS_AMPERE_AC_PEAK = 0x06; //!< electric current
const uint8_t UNITS_AMPERE_AC_RMS = 0x07; //!< electric current
const uint8_t UNITS_HERTZ = 0x08; //!< frequency
const uint8_t UNITS_OHM = 0x09; //!< electrical resistance
const uint8_t UNITS_WATT = 0x0A; //!< power or radiant flux
const uint8_t UNITS_KILOGRAM = 0x0B; //!< mass (1 000 grams)
const uint8_t UNITS_METERS = 0x0C; //!< length
const uint8_t UNITS_METERS_SQUARED = 0x0D; //!< area
const uint8_t UNITS_METERS_CUBED = 0x0E; //!< volume
const uint8_t UNITS_KILOGRAMES_PER_METER_CUBED = 0x0F; //!< density
const uint8_t UNITS_METERS_PER_SECOND = 0x10; //!< speed
const uint8_t UNITS_METERS_PER_SECOND_SQUARED = 0x11; //!< acceleration
const uint8_t UNITS_NEWTON = 0x12; //!< force
const uint8_t UNITS_JOULE = 0x13; //!< energy
const uint8_t UNITS_PASCAL = 0x14; //!< pressure (1 N/m²)
const uint8_t UNITS_SECOND = 0x15; //!< time
const uint8_t UNITS_DEGREE = 0x16; //!< plane angle
const uint8_t UNITS_STERADIAN = 0x17; //!< solid angle
const uint8_t UNITS_CANDELA = 0x18; //!< luminous intensity
const uint8_t UNITS_LUMEN = 0x19; //!< luminous flux
const uint8_t UNITS_LUX = 0x1A; //!< illuminance
const uint8_t UNITS_IRE = 0x1B; //!< video signal energy
const uint8_t UNITS_BYTE = 0x1C; //!< digital information
// Table A-14: Sensor Unit Prefix
const uint8_t PREFIX_NONE = 0x00; //!< 1
const uint8_t PREFIX_DECI = 0x01; //!< 0.1
const uint8_t PREFIX_CENTI = 0x02; //!< 0.01
const uint8_t PREFIX_MILLI = 0x03; //!< 0.001
const uint8_t PREFIX_MICRO = 0x04; //!< 0.000 001
const uint8_t PREFIX_NANO = 0x05; //!< 0.000 000 001
const uint8_t PREFIX_PICO = 0x06; //!< 0.000 000 000 001
const uint8_t PREFIX_FEMPTO = 0x07; //!< 0.000 000 000 000 001
const uint8_t PREFIX_ATTO = 0x08; //!< 0.000 000 000 000 000 001
const uint8_t PREFIX_ZEPTO = 0x09; //!< 0.000 000 000 000 000 000 001
const uint8_t PREFIX_YOCTO = 0x0a; //!< 0.000 000 000 000 000 000 000 001
const uint8_t PREFIX_DECA = 0x11; //!< 10
const uint8_t PREFIX_HECTO = 0x12; //!< 100
const uint8_t PREFIX_KILO = 0x13; //!< 1 000
const uint8_t PREFIX_MEGA = 0x14; //!< 1 000 000
const uint8_t PREFIX_GIGA = 0x15; //!< 1 000 000 000
const uint8_t PREFIX_TERA = 0x16; //!< 1 000 000 000 000
const uint8_t PREFIX_PETA = 0x17; //!< 1 000 000 000 000 000
const uint8_t PREFIX_EXA = 0x18; //!< 1 000 000 000 000 000 000
const uint8_t PREFIX_ZETTA = 0x19; //!< 1 000 000 000 000 000 000 000
const uint8_t PREFIX_YOTTA = 0x1a; //!< 1 000 000 000 000 000 000 000 000
// Table A-15: Data Type Defines
const uint8_t DS_NOT_DEFINED = 0x00; //!< Data is undefined
const uint8_t DS_BIT_FIELD = 0x01; //!< Data is bit packed
const uint8_t DS_ASCII = 0x02; //!< Data is a string
const uint8_t DS_UNSIGNED_BYTE = 0x03; //!< Data is an array of unsigned bytes
const uint8_t DS_SIGNED_BYTE = 0x04; //!< Data is an array of signed bytes
const uint8_t DS_UNSIGNED_WORD = 0x05; //!< Data is an array of unsigned 16-bit words
const uint8_t DS_SIGNED_WORD = 0x06; //!< Data is an array of signed 16-bit words
const uint8_t DS_UNSIGNED_DWORD = 0x07; //!< Data is an array of unsigned 32-bit words
const uint8_t DS_SIGNED_DWORD = 0x08; //!< Data is an array of signed 32-bit words
// Table A-16 Parameter Description Command Class
const uint8_t CC_DISC = 0b100; //!< PID supports DISCOVERY only \note Non-Standard value
const uint8_t CC_GET = 0b001; //!< PID supports GET only
const uint8_t CC_SET = 0b010; //!< PID supports SET only
const uint8_t CC_GET_SET = 0b011; //!< PID supports both GET and SET
/**
* @brief The Parameter Description class
*/
struct ParameterDescription
{
PID pid = 0; //!< PID #
/// Defined PDL sizes are the minimum reqired length.
/// \note Optional data lengths must be verified in the PID Action
struct {
uint8_t get = 0; // use get size for discovery size
uint8_t get_response = 0; // use get_response size for discovery response size
uint8_t set = 0;
uint8_t set_response = 0;
} pdl; //!< PDL field
uint8_t data_type = DS_NOT_DEFINED; //!< Table A-15 field code.
uint8_t command_class = -1; //!< Table A-16 field code.
const uint8_t type = 0; //!< no longer has any meaning
uint8_t unit = UNITS_NONE; //!< Table A-13 SI unit.
uint8_t prefix = PREFIX_NONE; //!< Table A-14 SI prefix.
uint32_t minimum_value = 0; //!< The lowest value that data can reach.
uint32_t maximum_value = std::numeric_limits<uint32_t>::max(); //!< The hightest value that data can reach.
uint32_t default_value = 0; //!< the default value of that data.
char description[32] = {0}; //!< Describe the function of the specified PID.
};
} // namespace RDM

View File

@ -27,34 +27,39 @@
#include "E1.37-2.h"
#include "E1.37-7.h"
#include "parameterdescription.h"
#include <string>
/**
* @brief \cite RDM The Remote Device Management Protocol
*/
namespace RDM {
using PID = uint16_t; //!< Parameter Identification number
/// \cite RDM 10.5.1 Get Device Info (DEVICE_INFO)
/// RDM Protocol Version:
/// The version of this standard is 1.0
static const uint16_t RDM_PROTOCOL_VERSION = 0x0100;
/// Appendix A: Defined Parameters (Normative)
// Appendix A: Defined Parameters (Normative)
// START Codes (Slot 0)
/// START Codes (Slot 0)
static const uint8_t SC_RDM = 0xCC;
/// RDM Protocol Data Structure IDs (Slot 1)
// RDM Protocol Data Structure IDs (Slot 1)
static const uint8_t SC_SUB_MESSAGE = 0x01;
/// Broadcast Device UIDs
// Broadcast Device UIDs
static const uint64_t BROADCAST_ALL_DEVICES_ID = 0xFFFFFFFFFFFF; //!< Broadcast all Manufacturers
static const uint64_t ALL_DEVICE_ID_MASK = 0x0000FFFFFFFF; //!< Specific Manufacturer ID in hight 2 bytes
static const uint16_t SUB_DEVICE_ALL_CALL = 0xFFFF;
/// Table A-1: Command Class Defines (Slot 20)
// Table A-1: Command Class Defines (Slot 20)
static const uint8_t DISCOVERY_COMMAND = 0x10;
static const uint8_t DISCOVERY_COMMAND_RESPONSE = 0x11;
static const uint8_t GET_COMMAND = 0x20;
@ -62,7 +67,9 @@ namespace RDM {
static const uint8_t SET_COMMAND = 0x30;
static const uint8_t SET_COMMAND_RESPONSE = 0x31;
/// Table A-2: Response Type Defines (Slot 16)
// Table A-2: Response Type Defines (Slot 16)
static const uint8_t RESPONSE_TYPE_ACK = 0x00;
static const uint8_t RESPONSE_TYPE_ACK_TIMER = 0x01;
static const uint8_t RESPONSE_TYPE_NACK_REASON = 0x02; //!< See Table A-17
@ -132,7 +139,8 @@ namespace RDM {
static const PID CAPTURE_PRESET = 0x1030;
static const PID PRESET_PLAYBACK = 0x1031;
/// Table A-4: Status Type Defines
// Table A-4: Status Type Defines
static const uint8_t STATUS_NONE = 0x00; //!< Not allowed for use with GET: QUEUED_MESSAGE
static const uint8_t STATUS_GET_LAST_MESSAGE = 0x01;
static const uint8_t STATUS_ADVISORY = 0x02;
@ -143,15 +151,15 @@ namespace RDM {
static const uint8_t STATUS_ERROR_CLEARED = 0x14;
std::string ProductCategoryDescription(const uint16_t PRODUCT_CATEGORY);
/// Table A-5: Product Category Defines
// Table A-5: Product Category Defines
static const uint16_t PRODUCT_CATEGORY_NOT_DECLARED = 0x0000;
/// Fixtures intended as source of illumination
// Fixtures intended as source of illumination
static const uint16_t PRODUCT_CATEGORY_FIXTURE = 0x0100; //!< No Fine Category declared
static const uint16_t PRODUCT_CATEGORY_FIXTURE_FIXED = 0x0101; //!< No pan / tilt / focus style functions
static const uint16_t PRODUCT_CATEGORY_FIXTURE_MOVING_YOKE = 0x0102;
static const uint16_t PRODUCT_CATEGORY_FIXTURE_MOVING_MIRROR = 0x0103;
static const uint16_t PRODUCT_CATEGORY_FIXTURE_OTHER = 0x01FF; //!< For example, focus but no pan/tilt.
/// Fixture Accessories add-ons to fixtures or projectors
// Fixture Accessories add-ons to fixtures or projectors
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY = 0x0200; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY_COLOR = 0x0201; //!< Scrollers / Color Changers
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY_YOKE = 0x0202; //!< Yoke add-on
@ -159,18 +167,18 @@ namespace RDM {
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY_EFFECT = 0x0204; //!< Effects Discs
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY_BEAM = 0x0205; //!< Gobo Rotators / Iris / Shutters / Dousers / Beam modifiers.
static const uint16_t PRODUCT_CATEGORY_FIXTURE_ACCESSORY_OTHER = 0x02FF;
/// Projectors - light source capable of producing realistic images from another media
// Projectors - light source capable of producing realistic images from another media
static const uint16_t PRODUCT_CATEGORY_PROJECTOR = 0x0300; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_PROJECTOR_FIXED = 0x0301; //!< No pan / tilt functions.
static const uint16_t PRODUCT_CATEGORY_PROJECTOR_MOVING_YOKE = 0x0302;
static const uint16_t PRODUCT_CATEGORY_PROJECTOR_MOVING_MIRROR = 0x0303;
static const uint16_t PRODUCT_CATEGORY_PROJECTOR_OTHER = 0x03FF;
/// Atmospheric Effect earth/wind/fire
// Atmospheric Effect earth/wind/fire
static const uint16_t PRODUCT_CATEGORY_ATMOSPHERIC = 0x0400; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_ATMOSPHERIC_EFFECT = 0x0401; //!< Fogger / Hazer / Flame, etc.
static const uint16_t PRODUCT_CATEGORY_ATMOSPHERIC_PYRO = 0x0402; //!< See Note 2.
static const uint16_t PRODUCT_CATEGORY_ATMOSPHERIC_OTHER = 0x04FF;
/// Intensity Control (specifically Dimming equipment)
// Intensity Control (specifically Dimming equipment)
static const uint16_t PRODUCT_CATEGORY_DIMMER = 0x0500; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_DIMMER_AC_INCANDESCENT = 0x0501; //!< AC > 50VAC
static const uint16_t PRODUCT_CATEGORY_DIMMER_AC_FLUORESCENT = 0x0502;
@ -182,47 +190,47 @@ namespace RDM {
static const uint16_t PRODUCT_CATEGORY_DIMMER_DC_PWM = 0x0508; //!< Chopped (PWM) output.
static const uint16_t PRODUCT_CATEGORY_DIMMER_CS_LED = 0x0509; //!< Specialized LED dimmer.
static const uint16_t PRODUCT_CATEGORY_DIMMER_OTHER = 0x05FF;
/// Power Control (other than Dimming equipment)
// Power Control (other than Dimming equipment)
static const uint16_t PRODUCT_CATEGORY_POWER = 0x0600; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_POWER_CONTROL = 0x0601; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_POWER_SOURCE = 0x0602; //!< Generators
static const uint16_t PRODUCT_CATEGORY_POWER_OTHER = 0x06FF;
/// Scenic Drive including motorized effects unrelated to light source.
// Scenic Drive including motorized effects unrelated to light source.
static const uint16_t PRODUCT_CATEGORY_SCENIC = 0x0700;
static const uint16_t PRODUCT_CATEGORY_SCENIC_DRIVE = 0x0701; //!< Rotators / Kabuki drops, etc.
static const uint16_t PRODUCT_CATEGORY_SCENIC_OTHER = 0x07FF;
/// DMX Infrastructure, conversion and interfaces
// DMX Infrastructure, conversion and interfaces
static const uint16_t PRODUCT_CATEGORY_DATA = 0x0800;
static const uint16_t PRODUCT_CATEGORY_DATA_DISTRIBUTION = 0x0801;
static const uint16_t PRODUCT_CATEGORY_DATA_CONVERSION = 0x0802;
static const uint16_t PRODUCT_CATEGORY_DATA_OTHER = 0x08FF;
/// Audio-Visual Equipment
// Audio-Visual Equipment
static const uint16_t PRODUCT_CATEGORY_AV = 0x0900;
static const uint16_t PRODUCT_CATEGORY_AV_AUDIO = 0x0901;
static const uint16_t PRODUCT_CATEGORY_AV_VIDEO = 0x0902;
static const uint16_t PRODUCT_CATEGORY_AV_OTHER = 0x09FF;
/// Parameter Monitoring Equipment
// Parameter Monitoring Equipment
static const uint16_t PRODUCT_CATEGORY_MONITOR = 0x0A00;
static const uint16_t PRODUCT_CATEGORY_MONITOR_ACLINEPOWER = 0x0A01;
static const uint16_t PRODUCT_CATEGORY_MONITOR_DCPOWER = 0x0A02;
static const uint16_t PRODUCT_CATEGORY_MONITOR_ENVIRONMENTAL = 0x0A03;
static const uint16_t PRODUCT_CATEGORY_MONITOR_OTHER = 0x0AFF;
/// Controllers, Backup devices
// Controllers, Backup devices
static const uint16_t PRODUCT_CATEGORY_CONTROL = 0x7000;
static const uint16_t PRODUCT_CATEGORY_CONTROL_CONTROLLER = 0x7001;
static const uint16_t PRODUCT_CATEGORY_CONTROL_BACKUPDEVICE = 0x7002;
static const uint16_t PRODUCT_CATEGORY_CONTROL_OTHER = 0x70FF;
/// Test Equipment
// Test Equipment
static const uint16_t PRODUCT_CATEGORY_TEST = 0x7100; //!< No Fine Category declared.
static const uint16_t PRODUCT_CATEGORY_TEST_EQUIPMENT = 0x7101;
static const uint16_t PRODUCT_CATEGORY_TEST_EQUIPMENT_OTHER = 0x71FF;
/// Miscellaneous
// Miscellaneous
static const uint16_t PRODUCT_CATEGORY_OTHER = 0x7FFF; //!< For devices that arent described within this table.
std::string ProductDetailDescription(const uint16_t PRODUCT_DETAIL);
/// Table A-6: Product Detail
// Table A-6: Product Detail
static const uint16_t PRODUCT_DETAIL_NOT_DECLARED = 0x0000;
/// Generally applied to fixtures
// Generally applied to fixtures
static const uint16_t PRODUCT_DETAIL_ARC = 0x0001;
static const uint16_t PRODUCT_DETAIL_METAL_HALIDE = 0x0002;
static const uint16_t PRODUCT_DETAIL_INCANDESCENT = 0x0003;
@ -232,7 +240,7 @@ namespace RDM {
static const uint16_t PRODUCT_DETAIL_ELECTROLUMINESCENT = 0x0007;
static const uint16_t PRODUCT_DETAIL_LASER = 0x0008;
static const uint16_t PRODUCT_DETAIL_FLASHTUBE = 0x0009;
/// Generally applied to fixture accessories
// Generally applied to fixture accessories
static const uint16_t PRODUCT_DETAIL_COLORSCROLLER = 0x0100;
static const uint16_t PRODUCT_DETAIL_COLORWHEEL = 0x0101;
static const uint16_t PRODUCT_DETAIL_COLORCHANGE = 0x0102;
@ -242,13 +250,13 @@ namespace RDM {
static const uint16_t PRODUCT_DETAIL_BARNDOOR_SHUTTER = 0x0106;
static const uint16_t PRODUCT_DETAIL_EFFECTS_DISC = 0x0107;
static const uint16_t PRODUCT_DETAIL_GOBO_ROTATOR = 0x0108;
/// Generally applied to Projectors
// Generally applied to Projectors
static const uint16_t PRODUCT_DETAIL_VIDEO = 0x0200;
static const uint16_t PRODUCT_DETAIL_SLIDE = 0x0201;
static const uint16_t PRODUCT_DETAIL_FILM = 0x0202;
static const uint16_t PRODUCT_DETAIL_OILWHEEL = 0x0203;
static const uint16_t PRODUCT_DETAIL_LCDGATE = 0x0204;
/// Generally applied to Atmospheric Effects
// Generally applied to Atmospheric Effects
static const uint16_t PRODUCT_DETAIL_FOGGER_GLYCOL = 0x0300;
static const uint16_t PRODUCT_DETAIL_FOGGER_MINERALOIL = 0x0301;
static const uint16_t PRODUCT_DETAIL_FOGGER_WATER = 0x0302;
@ -263,7 +271,7 @@ namespace RDM {
static const uint16_t PRODUCT_DETAIL_WIND = 0x030b;
static const uint16_t PRODUCT_DETAIL_CONFETTI = 0x030c;
static const uint16_t PRODUCT_DETAIL_HAZARD = 0x030d;
/// Generally applied to Dimmers/Power controllers
// Generally applied to Dimmers/Power controllers
static const uint16_t PRODUCT_DETAIL_PHASE_CONTROL = 0x0400;
static const uint16_t PRODUCT_DETAIL_REVERSE_PHASE_CONTROL = 0x0401;
static const uint16_t PRODUCT_DETAIL_SINE = 0x0402;
@ -280,7 +288,7 @@ namespace RDM {
static const uint16_t PRODUCT_DETAIL_RELAY_ELECTRONIC = 0x040d;
static const uint16_t PRODUCT_DETAIL_SWITCH_ELECTRONIC = 0x040e;
static const uint16_t PRODUCT_DETAIL_CONTACTOR = 0x040f;
/// Generally applied to Scenic drive
// Generally applied to Scenic drive
static const uint16_t PRODUCT_DETAIL_MIRRORBALL_ROTATOR = 0x0500;
static const uint16_t PRODUCT_DETAIL_OTHER_ROTATOR = 0x0501;
static const uint16_t PRODUCT_DETAIL_KABUKI_DROP = 0x0502;
@ -288,37 +296,37 @@ namespace RDM {
static const uint16_t PRODUCT_DETAIL_LINESET = 0x0504;
static const uint16_t PRODUCT_DETAIL_MOTOR_CONTROL = 0x0505;
static const uint16_t PRODUCT_DETAIL_DAMPER_CONTROL = 0x0506;
/// Generally applied to Data Distribution
// Generally applied to Data Distribution
static const uint16_t PRODUCT_DETAIL_SPLITTER = 0x0600;
static const uint16_t PRODUCT_DETAIL_ETHERNET_NODE = 0x0601;
static const uint16_t PRODUCT_DETAIL_MERGE = 0x0602;
static const uint16_t PRODUCT_DETAIL_DATAPATCH = 0x0603;
static const uint16_t PRODUCT_DETAIL_WIRELESS_LINK = 0x0604;
/// Generally applied to Data Conversion and Interfaces
// Generally applied to Data Conversion and Interfaces
static const uint16_t PRODUCT_DETAIL_PROTOCOL_CONVERTOR = 0x0701;
static const uint16_t PRODUCT_DETAIL_ANALOG_DEMULTIPLEX = 0x0702;
static const uint16_t PRODUCT_DETAIL_ANALOG_MULTIPLEX = 0x0703;
static const uint16_t PRODUCT_DETAIL_SWITCH_PANEL = 0x0704;
/// Generally applied to Audio or Video (AV) devices
// Generally applied to Audio or Video (AV) devices
static const uint16_t PRODUCT_DETAIL_ROUTER = 0x0800;
static const uint16_t PRODUCT_DETAIL_FADER = 0x0801;
static const uint16_t PRODUCT_DETAIL_MIXER = 0x0802;
/// Generally applied to Controllers, Backup devices and Test Equipment
// Generally applied to Controllers, Backup devices and Test Equipment
static const uint16_t PRODUCT_DETAIL_CHANGEOVER_MANUAL = 0x0900;
static const uint16_t PRODUCT_DETAIL_CHANGEOVER_AUTO = 0x0901;
static const uint16_t PRODUCT_DETAIL_TEST = 0x0902;
/// Could be applied to any category
// Could be applied to any category
static const uint16_t PRODUCT_DETAIL_GFI_RCD = 0x0A00;
static const uint16_t PRODUCT_DETAIL_BATTERY = 0x0A01;
static const uint16_t PRODUCT_DETAIL_CONTROLLABLE_BREAKER = 0x0A02;
/// for where the Manufacturer believes that none of the defined details apply.
// for where the Manufacturer believes that none of the defined details apply.
static const uint16_t PRODUCT_DETAIL_OTHER = 0x7FFF;
/// Table A-7: Preset Playback Defines
// Table A-7: Preset Playback Defines
static const uint16_t PRESET_PLAYBACK_OFF = 0x0000;
static const uint16_t PRESET_PLAYBACK_ALL = 0xFFFF;
/// Table A-8: Lamp State Defines
// Table A-8: Lamp State Defines
static const uint8_t LAMP_OFF = 0x00;
static const uint8_t LAMP_ON = 0x01;
static const uint8_t LAMP_STRIKE = 0x02;
@ -326,23 +334,23 @@ namespace RDM {
static const uint8_t LAMP_NOT_PRESENT = 0x04;
static const uint8_t LAMP_ERROR = 0x7F;
/// Table A-9: Lamp On Mode Defines
// Table A-9: Lamp On Mode Defines
static const uint8_t LAMP_ON_MODE_OFF = 0x00;
static const uint8_t LAMP_ON_MODE_DMX = 0x01;
static const uint8_t LAMP_ON_MODE_ON = 0x02;
static const uint8_t LAMP_ON_MODE_AFTER_CAL = 0x03;
/// Table A-10: Self Test Defines
// Table A-10: Self Test Defines
static const uint8_t SELF_TEST_OFF = 0x00;
static const uint8_t SELF_TEST_ALL = 0xFF;
/// Table A-11: Power State Defines
// Table A-11: Power State Defines
static const uint8_t POWER_STATE_FULL_OFF = 0x00;
static const uint8_t POWER_STATE_SHUTDOWN = 0x01;
static const uint8_t POWER_STATE_STANDBY = 0x02;
static const uint8_t POWER_STATE_NORMAL = 0xFF;
/// Table A-12: Sensor Type Defines
// Table A-12: Sensor Type Defines
static const uint8_t SENS_TEMPERATURE = 0x00;
static const uint8_t SENS_VOLTAGE = 0x01;
static const uint8_t SENS_CURRENT = 0x02;
@ -378,78 +386,10 @@ namespace RDM {
static const uint8_t SENS_COUNTER_16BIT = 0x20;
static const uint8_t SENS_OTHER = 0x7f;
/// Table A-13: Sensor Unit Defines
static const uint8_t UNITS_NONE = 0x00;
static const uint8_t UNITS_CENTIGRADE = 0x01;
static const uint8_t UNITS_VOLTS_DC = 0x02;
static const uint8_t UNITS_VOLTS_AC_PEAK = 0x03;
static const uint8_t UNITS_VOLTS_AC_RMS = 0x04;
static const uint8_t UNITS_AMPERE_DC = 0x05;
static const uint8_t UNITS_AMPERE_AC_PEAK = 0x06;
static const uint8_t UNITS_AMPERE_AC_RMS = 0x07;
static const uint8_t UNITS_HERTZ = 0x08;
static const uint8_t UNITS_OHM = 0x09;
static const uint8_t UNITS_WATT = 0x0A;
static const uint8_t UNITS_KILOGRAM = 0x0B;
static const uint8_t UNITS_METERS = 0x0C;
static const uint8_t UNITS_METERS_SQUARED = 0x0D;
static const uint8_t UNITS_METERS_CUBED = 0x0E;
static const uint8_t UNITS_KILOGRAMMES_PER_METER_CUBED = 0x0F;
static const uint8_t UNITS_METERS_PER_SECOND = 0x10;
static const uint8_t UNITS_METERS_PER_SECOND_SQUARED = 0x11;
static const uint8_t UNITS_NEWTON = 0x12;
static const uint8_t UNITS_JOULE = 0x13;
static const uint8_t UNITS_PASCAL = 0x14;
static const uint8_t UNITS_SECOND = 0x15;
static const uint8_t UNITS_DEGREE = 0x16;
static const uint8_t UNITS_STERADIAN = 0x17;
static const uint8_t UNITS_CANDELA = 0x18;
static const uint8_t UNITS_LUMEN = 0x19;
static const uint8_t UNITS_LUX = 0x1A;
static const uint8_t UNITS_IRE = 0x1B;
static const uint8_t UNITS_BYTE = 0x1C;
/// Table A-14: Sensor Unit Prefix
static const uint8_t PREFIX_NONE = 0x00;
static const uint8_t PREFIX_DECI = 0x01;
static const uint8_t PREFIX_CENTI = 0x02;
static const uint8_t PREFIX_MILLI = 0x03;
static const uint8_t PREFIX_MICRO = 0x04;
static const uint8_t PREFIX_NANO = 0x05;
static const uint8_t PREFIX_PICO = 0x06;
static const uint8_t PREFIX_FEMPTO = 0x07;
static const uint8_t PREFIX_ATTO = 0x08;
static const uint8_t PREFIX_ZEPTO = 0x09;
static const uint8_t PREFIX_YOCTO = 0x0a;
static const uint8_t PREFIX_DECA = 0x11;
static const uint8_t PREFIX_HECTO = 0x12;
static const uint8_t PREFIX_KILO = 0x13;
static const uint8_t PREFIX_MEGA = 0x14;
static const uint8_t PREFIX_GIGA = 0x15;
static const uint8_t PREFIX_TERRA = 0x16;
static const uint8_t PREFIX_PETA = 0x17;
static const uint8_t PREFIX_EXA = 0x18;
static const uint8_t PREFIX_ZETTA = 0x19;
static const uint8_t PREFIX_YOTTA = 0x1a;
/// Table A-15: Data Type Defines
static const uint8_t DS_NOT_DEFINED = 0x00;
static const uint8_t DS_BIT_FIELD = 0x01; //!< Data is bit packed
static const uint8_t DS_ASCII = 0x02; //!< Data is a string
static const uint8_t DS_UNSIGNED_BYTE = 0x03; //!< Data is an array of unsigned bytes
static const uint8_t DS_SIGNED_BYTE = 0x04; //!< Data is an array of signed bytes
static const uint8_t DS_UNSIGNED_WORD = 0x05; //!< Data is an array of unsigned 16-bit words
static const uint8_t DS_SIGNED_WORD = 0x06; //!< Data is an array of signed 16-bit words
static const uint8_t DS_UNSIGNED_DWORD = 0x07; //!< Data is an array of unsigned 32-bit words
static const uint8_t DS_SIGNED_DWORD = 0x08;
/// Table A-16 Parameter Description Command Class
static const uint8_t CC_GET = 0x01; //!< PID supports GET only
static const uint8_t CC_SET = 0x02; //!< PID supports SET only
static const uint8_t CC_GET_SET = 0x03;
// Tables A-13 thru A-16 are in parameterdescription.h
std::string NackReasonDescription(const uint16_t NR);
/// Table A-17: Response NACK Reason Code
// Table A-17: Response NACK Reason Code
static const uint16_t NR_UNKNOWN_PID = 0x0000;
static const uint16_t NR_FORMAT_ERROR = 0x0001;
static const uint16_t NR_HARDWARE_FAULT = 0x0002;
@ -462,7 +402,9 @@ namespace RDM {
static const uint16_t NR_SUB_DEVICE_OUT_OF_RANGE = 0x0009;
static const uint16_t NR_PROXY_BUFFER_FULL = 0x000A;
std::string StatusMessageDescription(const uint16_t status);
std::string StatusMessageDescription(const uint16_t status,
std::string label = std::string(),
int data1 = 0, int data2 = 0);
/// Appendix B: Status Message IDs (Normative)
/// %d Decimal Number -- as decimal number
/// %x Hexadecimal Number -- as hexadecimal number
@ -493,9 +435,9 @@ namespace RDM {
static const uint16_t STS_LOW_FLUID = 0x0052; //!< “%L low fluid”
/// Appendix C: Slot Info (Normative)
// Appendix C: Slot Info (Normative)
/// Table C-1: Slot Type
// Table C-1: Slot Type
static const uint8_t ST_PRIMARY = 0x00; //!< Slot directly controls parameter (represents Coarse for 16-bit parameters)
static const uint8_t ST_SEC_FINE = 0x01; //!< Fine, for 16-bit parameters
static const uint8_t ST_SEC_TIMING = 0x02; //!< Slot sets timing value for associated parameter
@ -506,14 +448,14 @@ namespace RDM {
static const uint8_t ST_SEC_INDEX_ROTATE = 0x07; //!< Combined index/rotation control
static const uint8_t ST_SEC_UNDEFINED = 0xff; //!< Undefined secondary type
/// Table C-2: Slot ID Definitions
/// Intensity Functions
// Table C-2: Slot ID Definitions
// Intensity Functions
static const uint16_t SD_INTENSITY = 0x0001;
static const uint16_t SD_INTENSITY_MASTER = 0x0002;
/// Movement Functions
// Movement Functions
static const uint16_t SD_PAN = 0x0101;
static const uint16_t SD_TILT = 0x0102;
/// Color Functions
// Color Functions
static const uint16_t SD_COLOR_WHEEL = 0x0201;
static const uint16_t SD_COLOR_SUB_CYAN = 0x0202;
static const uint16_t SD_COLOR_SUB_YELLOW = 0x0203;
@ -524,12 +466,12 @@ namespace RDM {
static const uint16_t SD_COLOR_CORRECTION = 0x0208;
static const uint16_t SD_COLOR_SCROLL = 0x0209;
static const uint16_t SD_COLOR_SEMAPHORE = 0x0210;
/// Image Functions
// Image Functions
static const uint16_t SD_STATIC_GOBO_WHEEL = 0x0301;
static const uint16_t SD_ROTO_GOBO_WHEEL = 0x0302;
static const uint16_t SD_PRISM_WHEEL = 0x0303;
static const uint16_t SD_EFFECTS_WHEEL = 0x0304;
/// Beam Functions
// Beam Functions
static const uint16_t SD_BEAM_SIZE_IRIS = 0x0401;
static const uint16_t SD_EDGE = 0x0402;
static const uint16_t SD_FROST = 0x0403;
@ -539,7 +481,7 @@ namespace RDM {
static const uint16_t SD_SHUTTER_ROTATE = 0x0407;
static const uint16_t SD_DOUSER = 0x0408;
static const uint16_t SD_BARN_DOOR = 0x0409;
/// Control Functions
// Control Functions
static const uint16_t SD_LAMP_CONTROL = 0x0501;
static const uint16_t SD_FIXTURE_CONTROL = 0x0502;
static const uint16_t SD_FIXTURE_SPEED = 0x0503;