Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 269 additions & 2 deletions data/pid_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5371,6 +5371,7 @@
'name': 'LOCK_STATE_DESCRIPTION',
'value': 0x0642},

# These are ordered to match how they appear in E1.37-5
# IDENTIFY_TIMEOUT
{'get_request': {'items': []},
'get_response': {'items': [
Expand All @@ -5390,6 +5391,33 @@
'set_sub_device_range': 1,
'value': 0x1050},

# MANUFACTURER_URL
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'url',
'min_size': 2,
'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'MANUFACTURER_URL',
'value': 0x00d1},

# PRODUCT_URL
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'url',
'min_size': 2,
'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'PRODUCT_URL',
'value': 0x00d1},

# FIRMWARE_URL
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'url',
'min_size': 2,
'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'FIRMWARE_URL',
'value': 0x00d2},

# SHIPPING_LOCK
{'get_request': {'items': []},
'get_response': {'items': [
Expand Down Expand Up @@ -5418,6 +5446,15 @@
'name': 'POWER_OFF_READY',
'value': 0x1051},

# SERIAL_NUMBER
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'serial',
'max_size': 231,
'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'SERIAL_NUMBER',
'value': 0x00d3},

# TEST_DATA
{'get_request': {'items': [
{'name': 'pattern_length', 'type': 'uint16', 'range': [(0, 0x1000)]}
Expand Down Expand Up @@ -5446,13 +5483,86 @@
'set_sub_device_range': 1,
'value': 0x0016},

# COMMS_STATUS_NSC
{'get_request': {'items': []},
# This is a bit set, TODO(Peter): Work out how best to implement this
'get_response': {'items': [{'name': 'supported_fields', 'type': 'uint8'},
{'name': 'additive_checksum_of_most_recent_nsc_packet',
'type': 'uint32',
'labels': [(0xffffffff, 'Not Supported')]},
{'name': 'nsc_packet_count',
'type': 'uint32',
'labels': [(0xffffffff, 'Not Supported')]},
{'name': 'nsc_most_recent_slot_count',
'type': 'uint16',
'labels': [(0xffff, 'Not Supported')]},
{'name': 'nsc_minimum_slot_count',
'type': 'uint16',
'labels': [(0xffff, 'Not Supported')]},
{'name': 'nsc_maximum_slot_count',
'type': 'uint16',
'labels': [(0xffff, 'Not Supported')]},
{'name': 'nsc_error_count',
'type': 'uint32',
'labels': [(0xffffffff, 'Not Supported')]},
]},
'get_sub_device_range': 0,
'name': 'COMMS_STATUS_NSC',
'set_request': {'items': []},
'set_response': {'items': []},
'set_sub_device_range': 0,
'value': 0x0017},

# LIST_TAGS
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'tags',
'type': 'string'}]},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't mind a second opinion on this @kripton .

It's a string, but it's also a null delimited list of tags. E.g. foo\0bar\0baz\0 . Always with the trailing null according to the spec.

The rest of the E1.20 text handling stuff says when you have a string and you see a null, you truncate on it, so our stuff all does this, so getting the above list just gives foo. 😞

Thoughts, do we add some special flag to a strings to say it may contain nulls and don't touch them, or make this a group of 1 character strings or bytes or something quirky?

I guess maybe we should see how E1.37-5's JSON stuff ends up handling it; I don't think they've a plan yet either...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it depends on which characters are allowed for a tag. If commas or semicolons are not allowed, we could use those as separators, only sending the spec-conform, \0-delimited string on the wire and transforming it back right when we received it.
If JSON is expected, usually dots or quotation marks are not allowed, even though they could be escaped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the spec says any character apart from \0 is allowed.

This is sort of what this should do. Normally this takes the byte stream and converts it into the "raw" types (e.g. uint/string/UID etc), then there's another level above which can do some additional pretty printing (e.g. rendering the clock fields as a timestamp, rather than individual fields, in https://github.com/OpenLightingProject/ola/blob/master/include/ola/rdm/RDMMessagePrinters.h ).

So I guess ideally we'd be passing back an array of strings (split from the nulls), but then we get lots of edge cases of one "item" essentially needs two sets of properties, it's combined max length, and then the max length of each of the to be produced array elements. The delimiter etc.

Well TBH ideally they'd have picked something like the record separator (as I suggested) to avoid this issue).

I guess it's a case of where we cause lots of chaos, in the base string object processing, which then needs to produce either a simple string or an array of strings (and all the knock ons with sizing of groups etc). Or downstream in the RDM tests and printer (if we just return an array of single byte values and post-process).

The E1.33 scope stuff feels a bit easier, as it's just a case of being able to null pad a string, so it's always 63 octets long.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually maybe following E1.37-5's JSON does sort of hold the answer. They've put it as bytes, which would be equivalent to our array of uint8 or chars, as I was proposing before, and which we can unpick to what we want in the higher level...

'get_sub_device_range': 2,
'name': 'LIST_TAGS',
'value': 0x0651},

# ADD_TAG
{'set_request': {'items': [{'name': 'tag',
'type': 'string',
'max_size': 32}]},
'set_response': {'items': []},
'set_sub_device_range': 1,
'name': 'ADD_TAG',
'value': 0x0652},

# REMOVE_TAG
{'set_request': {'items': [{'name': 'tag',
'type': 'string',
'max_size': 32}]},
'set_response': {'items': []},
'set_sub_device_range': 1,
'name': 'REMOVE_TAG',
'value': 0x0653},

# CHECK_TAG
{'get_request': {'items': [{'name': 'tag',
'type': 'string',
'max_size': 32}]},
'get_response': {'items': [{'name': 'tag_status',
'type': 'bool'}]},
'get_sub_device_range': 2,
'name': 'CHECK_TAG',
'value': 0x0654},

# CLEAR_TAGS
{'set_request': {'items': []},
'set_response': {'items': []},
'set_sub_device_range': 3,
'name': 'CLEAR_TAGS',
'value': 0x0655},

# DEVICE_UNIT_NUMBER
{'get_request': {'items': []},
'get_response': {'items': [
'get_response': {'items': [{
'name': 'device_unit_number',
'type': 'uint32',
'labels': [(0, 'Un-set')],
]},
}]},
'get_sub_device_range': 2,
'name': 'DEVICE_UNIT_NUMBER',
'set_request': {'items': [{
Expand All @@ -5465,6 +5575,138 @@
'set_sub_device_range': 2,
'value': 0x0656},

# DMX_PERSONALITY_ID
{'get_request': {'items': [{'name': 'personality', 'type': 'uint8', 'range': [
(1, 0xff)]
}]},
'get_response': {'items': [
{'name': 'personality', 'type': 'uint8'},
{'name': 'major_personality_id', 'type': 'uint16'},
{'name': 'minor_personality_id', 'type': 'uint16'},
]},
'get_sub_device_range': 2,
'name': 'DMX_PERSONALITY_ID',
'value': 0x00e2},

# DEVICE_INFO_OFFSTAGE
{'get_request': {'items': [
{'name': 'root_personality_requested',
'type': 'uint8',
'range': [(1, 0xff)]},
{'name': 'sub_device_requested',
'type': 'uint16',
'range': [(1, 0x0200)],
'labels': [(0, 'Root')]},
{'name': 'sub_device_personality_requested',
'type': 'uint8',
'range': [(1, 0xff)],
'labels': [(0, 'Root Device')]}
]},
'get_response': {'items': [{'name': 'root_personality_requested',
'type': 'uint8'},
{'name': 'sub_device_requested',
'type': 'uint16',
'labels': [(0, 'Root')]},
{'name': 'sub_device_personality_requested',
'type': 'uint8',
'labels': [(0, 'Root Device')]},
{'name': 'protocol_major', 'type': 'uint8'},
{'name': 'protocol_minor', 'type': 'uint8'},
{'name': 'device_model', 'type': 'uint16'},
{'name': 'product_category',
'type': 'uint16',
'labels': [(0x0000, 'Not declared'),
(0x0100, 'Fixture'),
(0x0101, 'Fixed fixture'),
(0x0102, 'Moving yoke fixture'),
(0x0103, 'Moving mirror fixture'),
(0x01ff, 'Fixture other'),
(0x0200, 'Fixture accessory'),
(0x0201, 'Fixture accessory color'),
(0x0202, 'Fixture accessory yoke'),
(0x0203, 'Fixture accessory mirror'),
(0x0204, 'Fixture accessory effect'),
(0x0205, 'Fixture accessory beam'),
(0x02ff, 'Fixture accessory other'),
(0x0300, 'Projector'),
(0x0301, 'Projector fixed'),
(0x0302, 'Projector moving yoke'),
(0x0303, 'Projector moving mirror'),
(0x03ff, 'Projector other'),
(0x0400, 'Atmospheric'),
(0x0401, 'Atmospheric effect'),
(0x0402, 'Atmospheric pyro'),
(0x04ff, 'Atmospheric other'),
(0x0500, 'Dimmer'),
(0x0501, 'Dimmer AC incandescent'),
(0x0502, 'Dimmer AC fluorescent'),
(0x0503, 'Dimmer AC cold cathode'),
(0x0504, 'Dimmer AC no dim'),
(0x0505, 'Dimmer AC ELV'),
(0x0506, 'Dimmer AC other'),
(0x0507, 'Dimmer DC level'),
(0x0508, 'Dimmer DC PWM'),
(0x0509, 'Dimmer DC LED'),
(0x05ff, 'Dimmer other'),
(0x0600, 'Power'),
(0x0601, 'Power control'),
(0x0602, 'Power source'),
(0x06ff, 'Power other'),
(0x0700, 'Scenic'),
(0x0701, 'Scenic drive'),
(0x07ff, 'Scenic other'),
(0x0800, 'Data'),
(0x0801, 'Data distribution'),
(0x0802, 'Data conversion'),
(0x08ff, 'Data other'),
(0x0900, 'A/V'),
(0x0901, 'A/V audio'),
(0x0902, 'A/V video'),
(0x09ff, 'AV other'),
(0x0a00, 'Monitor'),
(0x0a01, 'AC line power monitor'),
(0x0a02, 'DC power monitor'),
(0x0a03, 'Environmental monitor'),
(0x0aff, 'Other monitor'),
(0x7000, 'Control'),
(0x7001, 'Controller'),
(0x7002, 'Backup device'),
(0x70ff, 'Other control'),
(0x7100, 'Test'),
(0x7101, 'Test equipment'),
(0x71ff, 'Test equipment other'),
(0x7fff, 'Other')],
'range': [(0x0000, 0x0000),
(0x0100, 0x0103),
(0x01ff, 0x0205),
(0x02ff, 0x0303),
(0x03ff, 0x0402),
(0x04ff, 0x0509),
(0x05ff, 0x0602),
(0x06ff, 0x0701),
(0x07ff, 0x0802),
(0x08ff, 0x0902),
(0x09ff, 0x0a03),
(0x0aff, 0x0aff),
(0x7000, 0x7002),
(0x70ff, 0x7101),
(0x7fff, 0x7fff),
(0x8000, 0xdfff)]},
{'name': 'software_version',
'type': 'uint32'},
{'name': 'dmx_footprint', 'type': 'uint16'},
{'name': 'current_personality',
'type': 'uint8'},
{'name': 'personality_count',
'type': 'uint8'},
{'name': 'dmx_start_address', 'type': 'uint16'},
{'name': 'sub_device_count',
'type': 'uint16'},
{'name': 'sensor_count', 'type': 'uint8'}]},
'get_sub_device_range': 0,
'name': 'DEVICE_INFO_OFFSTAGE',
'value': 0x00d4},

# SENSOR_TYPE_CUSTOM
{'get_request': {'items': [
{'name': 'sensor_type_define', 'type': 'uint8',
Expand All @@ -5491,6 +5733,31 @@
'name': 'SENSOR_UNIT_CUSTOM',
'value': 0x0211},

# METADATA_PARAMETER_VERSION
{'get_request': {'items': [{'name': 'pid', 'type': 'uint16'}]},
'get_response': {'items': [{'name': 'pid', 'type': 'uint16'},
{'name': 'version', 'type': 'uint16'}]},
'get_sub_device_range': 2,
'name': 'METADATA_PARAMETER_VERSION',
'value': 0x0052},

# METADATA_JSON
{'get_request': {'items': [{'name': 'pid', 'type': 'uint16'}]},
'get_response': {'items': [{'name': 'pid', 'type': 'uint16'},
{'name': 'json', 'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'METADATA_JSON',
'value': 0x0053},

# METADATA_JSON_URL
{'get_request': {'items': []},
'get_response': {'items': [{'name': 'url',
'min_size': 2,
'type': 'string'}]},
'get_sub_device_range': 2,
'name': 'METADATA_JSON_URL',
'value': 0x0054},

# These are ordered to match how they appear in E1.37-7
# ENDPOINT_LIST
{'get_request': {'items': []},
Expand Down