Difference between revisions of "OpenIGTLink/ProtocolV2/Type/Bind"
(→BIND) |
(→BIND) |
||
Line 94: | Line 94: | ||
|- | |- | ||
|} | |} | ||
− | *Padding field is inserted only if the field does not | + | *Padding field is inserted only if the previous field does not aligned with WORD border. |
− | <font color="red">Feb 3, 2011: Padding fields are inserted in the | + | <font color="red">Feb 3, 2011: Padding fields are inserted in the data section. </font> |
==GET_BIND== | ==GET_BIND== |
Revision as of 05:37, 3 February 2011
Home < OpenIGTLink < ProtocolV2 < Type < BindContents
Summary
Bind message format is designed to bind any OpenIGTLink messages into a single message. Messages bound in a BIND message are called 'child messages.' The BIND message format is useful, when one needs to care about synchronization of multiple messages (e.g. multi-channel sensors), or sending associative array (pairs of key string and value). The bind message format consists of the bind header section, which contains types and sizes of child messages, the child message name table section, and the child message body section.
Message Types
BIND
Data | Type | Description |
NCMESSAGES | uint16 | Number of child messages |
Bind Header Section | ||
TYPE 0 | char[12] | Data type (OpenIGTLink Device Type string) for child message 0 |
DATA SIZE 0 | uint 64 | Data size for child message 0 |
... | ||
TYPE (NCMESSAGES-1) | char[12] | Data type (OpenIGTLink Device Type string) for child message (NCMESSAGES-1) |
DATA SIZE (NCMESSAGES-1) | uint 64 | Data size for child message (NCMESSAGES-1) |
NAME Table Section (NULL-separated values) | ||
NAME_TABLE_SIZE | uint16 | Size of name table (including the padding) |
NAME 0 | char[*] | Name for child message 0 |
(null) | uint8 | separator |
... | ||
NAME (NCMESSAGES-1) | char[*] | Name for child message (NCMESSAGES-1) |
(null) | uint8 | separator |
Padding* | uint8 or none | padding to align DATA with WORD |
Data Section | ||
DATA 0 | TYPE 0 ( SIZE 0 ) | Data array for child message 0 |
(Padding*) | uint8 or none | padding to align DATA with WORD |
DATA 1 | TYPE 1 ( SIZE 1 ) | Data array for child message 1 |
(Padding*) | uint8 or none | padding to align DATA with WORD |
... | ||
DATA (NCMESSAGES-1) | TYPE NCMESSAGE-1 (SIZE NCMESSAGE-1) | Data array for child message NCMESSAGE-1 |
Padding* | uint8 or none | padding to align DATA with WORD |
- Padding field is inserted only if the previous field does not aligned with WORD border.
Feb 3, 2011: Padding fields are inserted in the data section.
GET_BIND
GET_BIND is used to request the receiver for associative array data. If a GET_BIND message does not have a body, it requests all data.
Data | Type | Description |
NCMESSAGES | uint16 | Number of elements |
Bind Header Section | ||
TYPE 0 | char[12] | Data type (OpenIGTLink device type string) |
NAMELEN 0 | uint 8 | Name length |
SIZE 0 | uint 16 | Data length |
... | ||
TYPE (NCMESSAGES-1) | uint8 | Data type (0: string, 1: scalar, 2: vector) |
NAMELEN (NCMESSAGES-1) | uint 8 | Name length |
SIZE (NCMESSAGES-1) | uint 16 | Data length |
NAME Table | ||
NAME 0 | char[NAMELEN] | Name |
... | ||
NAME (NCMESSAGES-1) | char[NAMELEN (NCMESSAGES-1)] | Name |
STT_BIND
Data | Type | Description |
RESOL | uint64 | Minimum interval between message (ns). Same format as TimeStamp |
GET_BIND is used to request the receiver for associative array data. If a GET_BIND message does not have a body, it requests all data.
Data | Type | Description |
RESOL | uint64 | Minimum interval between message (ns). Same format as TimeStamp |
NCMESSAGES | uint16 | Number of elements |
Bind Header Section | ||
TYPE 0 | char[12] | Data type (OpenIGTLink device type string) |
SIZE 0 | uint 16 | Data length |
... | ||
TYPE (NCMESSAGES-1) | uint8 | Data type (0: string, 1: scalar, 2: vector) |
SIZE (NCMESSAGES-1) | uint 16 | Data length |
NAME Table Section (NULL-separated values) | ||
NAME_TABLE_SIZE | uint16 | Size of name table (including the padding) |
NAME 0 | char[*] | Name |
(null) | uint8 | separator |
... | ||
NAME (NCMESSAGES-1) | char[*] | Name |
(null) | uint8 | separator |
STP_BIND
Data | Type | Description |
RTS_BIND
Data | Type | Description |
Status | 8 bit unsigned | 0: Success 1: Error |
Implementations
Contributors
Junichi Tokuda, Yuichiro Hayashi