Difference between revisions of "OpenIGTLink"

From NAMIC Wiki
Jump to: navigation, search
(added some message types)
Line 53: Line 53:
 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
  
{| border="1" cellpadding="5" cellspacing="0" align="center"
+
{| border="1" cellpadding="5" cellspacing="0"  
 
|-
 
|-
 
| align="left style="background:#e0e0e0;" | Data
 
| align="left style="background:#e0e0e0;" | Data
Line 61: Line 61:
 
| align="left" | C
 
| align="left" | C
 
| align="left" | Unsigned short (16bit)
 
| align="left" | Unsigned short (16bit)
| align="left" | Status code: 01-Ok, 02-Generic Error, ...
+
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)
 
|-
 
|-
 
| align="left" | Sub Code
 
| align="left" | Sub Code
Line 69: Line 69:
 
| align="left" | Error name
 
| align="left" | Error name
 
| align="left" | char[20]
 
| align="left" | char[20]
| align="left" | "Error", "Ok", "Starting up"
+
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this
 
|-
 
|-
 
| align="left" | Status Message (optional)
 
| align="left" | Status Message (optional)
Line 76: Line 76:
 
|-
 
|-
 
|}
 
|}
 +
 +
 +
'''Status codes:'''<br />
 +
0 No Errors Found (use status 1 instead!)<br />
 +
1 OK (Default status)<br />
 +
2 Unknown error<br />
 +
3 Panic mode (emergency)<br />
 +
4 Not found (file, configuration, device etc)<br />
 +
5 Access denied<br />
 +
6 Busy<br />
 +
7 Time out / Connection lost<br />
 +
8 Overflow / Can't be reached<br />
 +
9 Checksum error<br />
 +
10 Configuration error<br />
 +
11 Not enough resource (memory, storage etc)<br />
 +
12 Illegal/Unknown instruction (or feature not implemented)<br />
 +
13 Device not ready (starting up)<br />
 +
14 Manual mode (device does not accept commands)<br />
 +
15 Device disabled<br />
 +
16 Device not present<br />
 +
17 Device version not known<br />
 +
18 Hardware failure<br />
 +
19 Exiting / shut down in progress<br />
 +
<br />

Revision as of 20:06, 9 January 2008

Home < OpenIGTLink

Overview

Protocol

Header Structure

 Bytes
 0   2                       14                                      34             42               50
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
 | V |          TYPE         |              DEVICE_NAME              |   BODY_SIZE   |      CRC      |   BODY  		  
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....

Byte Order

Big endian should be used.

Header Fields

Data Type Description
V Unsigned short (16bit) Version number (1)
TYPE char[8] Type name of body
DEVICE_NAME char[20] Unique device name
BODY_SIZE 64 bit unsigned int Size of body in bytes
CRC 64 bit unsigned int 64 bit CRC for body data

Message types

IMAGE

TRANSFORM

POSITION

STATUS

 Bytes (Body)
 50   52            60                           80
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
 | C |  Sub Code   |       Status name           |   Status message (optional)
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
Data Type Description
C Unsigned short (16bit) Status code groups: 1-Ok, 2-Generic Error, ... (see below)
Sub Code 64 bit integer Sub code for the error (ex. 0x200 - file not found)
Error name char[20] "Error", "Ok", "Starting up" - can be anything, don't relay on this
Status Message (optional) char[ BodySize - 30 ] Optional (English) description (ex. "File C:\test.ini not found")


Status codes:
0 No Errors Found (use status 1 instead!)
1 OK (Default status)
2 Unknown error
3 Panic mode (emergency)
4 Not found (file, configuration, device etc)
5 Access denied
6 Busy
7 Time out / Connection lost
8 Overflow / Can't be reached
9 Checksum error
10 Configuration error
11 Not enough resource (memory, storage etc)
12 Illegal/Unknown instruction (or feature not implemented)
13 Device not ready (starting up)
14 Manual mode (device does not accept commands)
15 Device disabled
16 Device not present
17 Device version not known
18 Hardware failure
19 Exiting / shut down in progress