我可以跨 RGBlink 全站支持数据库检索知识文章、产品和公开文档,帮你快速定位答案。
proAV
系统集成与商业项目支持
如问题涉及处理器控制、视频路由、安装设计、集成问题或 proAV 设备 OpenAPI,请从这里开始。
AI 支持搜索
支持知识
从左侧目录选择文章后,在此查看完整内容。
API / API Structure / Command Structure
Command Structure
Instructions to devices are made ASCII formatted with data elements in HEX.
Data Format
Transmit Instruction
Sending packets to devices must be in the format below. Note TYPE = "T" for transmit
| Header | Type | Data | End | |
|---|---|---|---|---|
| < | T | ADDR + SEQN + CMMD + DAT1 + DAT2 + DAT3 + DAT4 + CHKS | > | |
| bytes | 1 | 1 | 16 | 1 |
Receive Response
Packets received from a device are in below format. Note TYPE = "F" for transmit
| Header | Type | Data | End | |
|---|---|---|---|---|
| < | F | ADDR + SEQN + CMMD + DAT1 + DAT2 + DAT3 + DAT4 + CHKS | > | |
| bytes | 1 | 1 | 16 | 1 |
Example: Transmit
<T000268010000006B>
| Byte Position | 1 | 2 | 3&4 | 5&6 | 7&8 | 9&10 | 11&12 | 13&14 | 15&16 | 17&18 | 19 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Element | ADDR | SEQN | CMMD | DAT1 | DAT2 | DAT3 | DAT4 | CHKS | |||
| ASCII Data | < | T | 00 | 02 | 68 | 01 | 00 | 00 | 00 | 6B | > |
| HEX Data | 3C | 46 | 00 00 | 00 02 | 36 38 | 00 01 | 00 00 | 00 00 | 00 00 | 6B | 3E |
Data Elements
Definitions
Data sent or received is structured with elements
| Attribute | Name | Bytes | Byte Position | Default Value | |
|---|---|---|---|---|---|
| ADDR | Address | 2 | 3 | 00 | id of connected device |
| SEQN | Sequence Number | 2 | 5 | 00 | used for transmission control |
| CMMD | Command | 2 | 7 | valid command for connected device | |
| DAT1 | Data 1 | 2 | 9 | 1st data value for the CMD | |
| DAT2 | Data 2 | 2 | 11 | 2nd data value for the CMD | |
| DAT3 | Data 3 | 2 | 13 | 3rd data value for the CMD | |
| DAT4 | Data 4 | 2 | 15 | 4th data value for the CMD | |
| CHKS | Checksum | 2 | 17 | add the values of all preceding elements ie. ADDR + SEQN + CMMD + DAT1 + DAT2 + DAT3 + DAT4 |
Sequence Number (SEQN)
SEQN is used for data transmission control/flow.
SEQN=0x00 is set to establish a connection.
Each time the host sends a command, the SEQN increases by one. The host must control the flow according to the SEQN of the sent command and the SEQN of the received command. The host should only send the next command only if it has received the reply of the previous command. The use of SEQN flow control can reduce the time from sending a command to waiting for reception. It supports the linking of multiple instructions, which must be executed in sequence.
Checksum
A Checksum is used to validate the transmitted/received data. The checksum is a simple addition of the other/preceding data elements (2 byte elements in positions 3 to 16), with the right 2 bits of the sum being the checksum.
CHKS=@right(ADDR+SEQN+CMMD+DAT1+DAT2+DAT3+DAT4,2)
Example: Transmit
<T000268010000006B>
where 6B is the Checksum
Checksum is calculated as: 0x00 + 0x02 + 0x68 + 0x01 + 0x00 + 0x00 = 6B
| Byte Position | 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 |
|---|---|---|---|---|---|---|---|---|
| Element | ADDR | SEQN | CMMD | DAT1 | DAT2 | DAT3 | DAT4 | CHKS |
| ASCII Data | 00 | 02 | 68 | 01 | 00 | 00 | 00 | 6B |
Example: Receive
<F00006A1155550025>
where 25 is the Checksum
Checksum is calculated as: 0x00 + 0x02 + 0x68 + 0x01 + 0x00 + 0x00 = 125 => @right(125,2bits) = 12. Checksum is 25
| Byte Position | 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 |
|---|---|---|---|---|---|---|---|---|
| Element | ADDR | SEQN | CMMD | DAT1 | DAT2 | DAT3 | DAT4 | CHKS |
| ASCII Data | 00 | 00 | 6A | 11 | 55 | 55 | 00 | 25 |
Data Elements
DATx elements are used define the specific properties or to specify the size of trailing buffer payloads. In particular, commands 0xF0 (Set Operations) and 0xF1 (Query Device) use DAT3 and DAT4 to
indicate the length of the data block with DAT4 being the upper 8bits of the buffer/payload length and DAT3 being the lower 8bits of the buffer/payload length (to be concatenated).
Errors
Commands not accepted or with invalid DATx elements will have am Error Response in the format
-
FF is returned in the DATx elements
-
where below, XX (XX XX) is the CMMD that was received by the processor and ZZ (ZZ ZZ) is the Checksum
<F0000XXFFFFFFFFZZ>
| Byte Position | 1 | 2 | 3&4 | 5&6 | 7&8 | 9&10 | 11&12 | 13&14 | 15&16 | 17&18 | 19 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Element | ADDR | SEQN | CMMD | DAT1 | DAT2 | DAT3 | DAT4 | CHKS | |||
| ASCII Data | < | T | 00 | 02 | XX | FF | FF | FF | FF | ZZ | > |
| HEX Data | 3C | 46 | 00 00 | 00 02 | XX XX | 0F 0F | 0F 0F | 0F 0F | 0F 0F | ZZ ZZ | 3E |