Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_status.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: OpenIGTLink Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_status.h $
5  Language: C
6  Date: $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
7  Version: $Revision: 5466 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __IGTL_STATUS_H
18 #define __IGTL_STATUS_H
19 
20 #include "igtl_util.h"
21 #include "igtl_types.h"
22 
23 #define IGTL_STATUS_HEADER_SIZE 30
24 
25 #define IGTL_STATUS_ERROR_NAME_LENGTH 20
26 
27 /* Status codes */
28 
29 #define IGTL_STATUS_INVALID 0
30 #define IGTL_STATUS_OK 1
31 #define IGTL_STATUS_UNKNOWN_ERROR 2
32 #define IGTL_STATUS_PANICK_MODE 3 /* emergency */
33 #define IGTL_STATUS_NOT_FOUND 4 /* file, configuration, device etc */
34 #define IGTL_STATUS_ACCESS_DENIED 5
35 #define IGTL_STATUS_BUSY 6
36 #define IGTL_STATUS_TIME_OUT 7 /* Time out / Connection lost */
37 #define IGTL_STATUS_OVERFLOW 8 /* Overflow / Can't be reached */
38 #define IGTL_STATUS_CHECKSUM_ERROR 9 /* Checksum error */
39 #define IGTL_STATUS_CONFIG_ERROR 10 /* Configuration error */
40 #define IGTL_STATUS_RESOURCE_ERROR 11 /* Not enough resource (memory, storage etc) */
41 #define IGTL_STATUS_ILLEGAL_INSTRUCTION 12 /* Illegal/Unknown instruction */
42 #define IGTL_STATUS_NOT_READY 13 /* Device not ready (starting up)*/
43 #define IGTL_STATUS_MANUAL_MODE 14 /* Manual mode (device does not accept commands) */
44 #define IGTL_STATUS_DISABLED 15 /* Device disabled */
45 #define IGTL_STATUS_NOT_PRESENT 16 /* Device not present */
46 #define IGTL_STATUS_UNKNOWN_VERSION 17 /* Device version not known */
47 #define IGTL_STATUS_HARDWARE_FAILURE 18 /* Hardware failure */
48 #define IGTL_STATUS_SHUT_DOWN 19 /* Exiting / shut down in progress */
49 
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 #pragma pack(1) /* For 1-byte boundary in memroy */
56 
57 /*
58  * Status data header for OpenIGTLinik protocol
59  *
60  */
61 
62 typedef struct {
63  igtl_uint16 code; /* status code defined above */
64  igtl_int64 subcode; /* sub code for the error */
65  char error_name[IGTL_STATUS_ERROR_NAME_LENGTH];
66  /* error name -- can be anything, don't rely on this */
67  /*char status_message[]; */
69 
70 #pragma pack()
71 
72 /*
73  * Byte order conversion for the status data structure
74  *
75  * This function converts endianness of each member variable
76  * in igtl_status_header from host byte order to network byte order,
77  * or vice versa.
78  */
79 
81 
82 
83 /*
84  * CRC calculation
85  *
86  * This function calculates CRC of status data body including status message part
87  *
88  */
89 
90 igtl_uint64 igtl_export igtl_status_get_crc(igtl_status_header* status, igtl_uint32 msglen, const char* msg);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* __IGTL_IMAGE_H */
97 
98 
99 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000