Go to the documentation of this file.00001 #ifndef _TMR_STATUS_H
00002 #define _TMR_STATUS_H
00003
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "tm_config.h"
00034 #include <stdint.h>
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040 typedef uint32_t TMR_Status;
00041
00042 #define TMR_STATUS_MAKE(type, value) (((type) << 24) | (value))
00043 #define TMR_STATUS_GET_TYPE(x) (((x) >> 24) & 0xff)
00044 #define TMR_STATUS_GET_VALUE(x) ((x) & 0xffffff)
00045
00046 #define TMR_SUCCESS_TYPE 0L
00047 #define TMR_ERROR_TYPE_COMM 1L
00048 #define TMR_ERROR_TYPE_CODE 2L
00049 #define TMR_ERROR_TYPE_MISC 3L
00050 #define TMR_ERROR_TYPE_LLRP 4L
00051
00052 #define TMR_SUCCESS TMR_STATUS_MAKE(TMR_SUCCESS_TYPE, 0)
00053
00054 #define TMR_ERROR_CODE(x) TMR_STATUS_MAKE(TMR_ERROR_TYPE_CODE, (x))
00055 #define TMR_ERROR_IS_CODE(x) (TMR_ERROR_TYPE_CODE == TMR_STATUS_GET_TYPE(x))
00056 #define TMR_ERROR_GET_CODE(x) TMR_STATUS_GET_VALUE(x)
00057
00058 #define TMR_ERROR_MSG_WRONG_NUMBER_OF_DATA TMR_ERROR_CODE(0x100)
00059
00060 #define TMR_ERROR_INVALID_OPCODE TMR_ERROR_CODE(0x101)
00061
00062 #define TMR_ERROR_UNIMPLEMENTED_OPCODE TMR_ERROR_CODE(0x102)
00063
00064 #define TMR_ERROR_MSG_POWER_TOO_HIGH TMR_ERROR_CODE(0x103)
00065
00066 #define TMR_ERROR_MSG_INVALID_FREQ_RECEIVED TMR_ERROR_CODE(0x104)
00067
00068 #define TMR_ERROR_MSG_INVALID_PARAMETER_VALUE TMR_ERROR_CODE(0x105)
00069
00070 #define TMR_ERROR_MSG_POWER_TOO_LOW TMR_ERROR_CODE(0x106)
00071
00072 #define TMR_ERROR_UNIMPLEMENTED_FEATURE TMR_ERROR_CODE(0x109)
00073
00074 #define TMR_ERROR_INVALID_BAUD_RATE TMR_ERROR_CODE(0x10a)
00075
00076 #define TMR_ERROR_INVALID_REGION TMR_ERROR_CODE(0x10b)
00077
00078 #define TMR_ERROR_INVALID_LICENSE_KEY TMR_ERROR_CODE(0x10c)
00079
00080 #define TMR_ERROR_BL_INVALID_IMAGE_CRC TMR_ERROR_CODE(0x200)
00081
00082 #define TMR_ERROR_BL_INVALID_APP_END_ADDR TMR_ERROR_CODE(0x201)
00083
00084 #define TMR_ERROR_FLASH_BAD_ERASE_PASSWORD TMR_ERROR_CODE(0x300)
00085
00086 #define TMR_ERROR_FLASH_BAD_WRITE_PASSWORD TMR_ERROR_CODE(0x301)
00087
00088 #define TMR_ERROR_FLASH_UNDEFINED_SECTOR TMR_ERROR_CODE(0x302)
00089
00090 #define TMR_ERROR_FLASH_ILLEGAL_SECTOR TMR_ERROR_CODE(0x303)
00091
00092 #define TMR_ERROR_FLASH_WRITE_TO_NON_ERASED_AREA TMR_ERROR_CODE(0x304)
00093
00094 #define TMR_ERROR_FLASH_WRITE_TO_ILLEGAL_SECTOR TMR_ERROR_CODE(0x305)
00095
00096 #define TMR_ERROR_FLASH_VERIFY_FAILED TMR_ERROR_CODE(0x306)
00097
00098 #define TMR_ERROR_NO_TAGS_FOUND TMR_ERROR_CODE(0x400)
00099
00100 #define TMR_ERROR_NO_PROTOCOL_DEFINED TMR_ERROR_CODE(0x401)
00101
00102 #define TMR_ERROR_INVALID_PROTOCOL_SPECIFIED TMR_ERROR_CODE(0x402)
00103
00104 #define TMR_ERROR_WRITE_PASSED_LOCK_FAILED TMR_ERROR_CODE(0x403)
00105
00106 #define TMR_ERROR_PROTOCOL_NO_DATA_READ TMR_ERROR_CODE(0x404)
00107
00108 #define TMR_ERROR_AFE_NOT_ON TMR_ERROR_CODE(0x405)
00109
00110 #define TMR_ERROR_PROTOCOL_WRITE_FAILED TMR_ERROR_CODE(0x406)
00111
00112 #define TMR_ERROR_NOT_IMPLEMENTED_FOR_THIS_PROTOCOL TMR_ERROR_CODE(0x407)
00113
00114 #define TMR_ERROR_PROTOCOL_INVALID_WRITE_DATA TMR_ERROR_CODE(0x408)
00115
00116 #define TMR_ERROR_PROTOCOL_INVALID_ADDRESS TMR_ERROR_CODE(0x409)
00117
00118 #define TMR_ERROR_GENERAL_TAG_ERROR TMR_ERROR_CODE(0x40a)
00119
00120 #define TMR_ERROR_DATA_TOO_LARGE TMR_ERROR_CODE(0x40b)
00121
00122 #define TMR_ERROR_PROTOCOL_INVALID_KILL_PASSWORD TMR_ERROR_CODE(0x40c)
00123
00124 #define TMR_ERROR_PROTOCOL_KILL_FAILED TMR_ERROR_CODE(0x40e)
00125
00126 #define TMR_ERROR_PROTOCOL_BIT_DECODING_FAILED TMR_ERROR_CODE(0x40f)
00127
00128 #define TMR_ERROR_PROTOCOL_INVALID_EPC TMR_ERROR_CODE(0x410)
00129
00130 #define TMR_ERROR_PROTOCOL_INVALID_NUM_DATA TMR_ERROR_CODE(0x411)
00131
00132 #define TMR_ERROR_GEN2_PROTOCOL_OTHER_ERROR TMR_ERROR_CODE(0x420)
00133
00134 #define TMR_ERROR_GEN2_PROTOCOL_MEMORY_OVERRUN_BAD_PC TMR_ERROR_CODE(0x423)
00135
00136 #define TMR_ERROR_GEN2_PROCOCOL_MEMORY_LOCKED TMR_ERROR_CODE(0x424)
00137
00138 #define TMR_ERROR_GEN2_PROTOCOL_V2_AUTHEN_FAILED TMR_ERROR_CODE(0x425)
00139
00140 #define TMR_ERROR_GEN2_PROTOCOL_V2_UNTRACE_FAILED TMR_ERROR_CODE(0x426)
00141
00142 #define TMR_ERROR_GEN2_PROTOCOL_INSUFFICIENT_POWER TMR_ERROR_CODE(0x42b)
00143
00144 #define TMR_ERROR_GEN2_PROTOCOL_NON_SPECIFIC_ERROR TMR_ERROR_CODE(0x42f)
00145
00146 #define TMR_ERROR_GEN2_PROTOCOL_UNKNOWN_ERROR TMR_ERROR_CODE(0x430)
00147
00148 #define TMR_ERROR_AHAL_INVALID_FREQ TMR_ERROR_CODE(0x500)
00149
00150 #define TMR_ERROR_AHAL_CHANNEL_OCCUPIED TMR_ERROR_CODE(0x501)
00151
00152 #define TMR_ERROR_AHAL_TRANSMITTER_ON TMR_ERROR_CODE(0x502)
00153
00154 #define TMR_ERROR_ANTENNA_NOT_CONNECTED TMR_ERROR_CODE(0x503)
00155
00156 #define TMR_ERROR_TEMPERATURE_EXCEED_LIMITS TMR_ERROR_CODE(0x504)
00157
00158 #define TMR_ERROR_HIGH_RETURN_LOSS TMR_ERROR_CODE(0x505)
00159 #define TMR_ERROR_INVALID_ANTENNA_CONFIG TMR_ERROR_CODE(0x507)
00160
00161 #define TMR_ERROR_TAG_ID_BUFFER_NOT_ENOUGH_TAGS_AVAILABLE TMR_ERROR_CODE(0x600)
00162
00163 #define TMR_ERROR_TAG_ID_BUFFER_FULL TMR_ERROR_CODE(0x601)
00164
00165 #define TMR_ERROR_TAG_ID_BUFFER_REPEATED_TAG_ID TMR_ERROR_CODE(0x602)
00166
00167 #define TMR_ERROR_TAG_ID_BUFFER_NUM_TAG_TOO_LARGE TMR_ERROR_CODE(0x603)
00168
00169 #define TMR_ERROR_TAG_ID_BUFFER_AUTH_REQUEST TMR_ERROR_CODE(0x604)
00170
00171 #define TMR_ERROR_SYSTEM_UNKNOWN_ERROR TMR_ERROR_CODE(0x7f00)
00172
00173 #define TMR_ERROR_TM_ASSERT_FAILED TMR_ERROR_CODE(0x7f01)
00174
00175 #define TMR_ERROR_COMM(x) TMR_STATUS_MAKE(TMR_ERROR_TYPE_COMM, (x))
00176 #define TMR_ERROR_IS_COMM(x) (TMR_ERROR_TYPE_COMM == TMR_STATUS_GET_TYPE(x))
00177 #define TMR_ERROR_COMM_ERRNO(x) TMR_ERROR_COMM(0x8000 | (x))
00178 #define TMR_ERROR_COMM_IS_ERRNO(x) (0x8000 == (TMR_STATUS_GET_VALUE(x) & 0x8000))
00179 #define TMR_ERROR_COMM_GET_ERRNO(x) (TMR_STATUS_GET_VALUE(x) & 0x7fff)
00180 #define TMR_ERROR_TIMEOUT TMR_ERROR_COMM(1)
00181 #define TMR_ERROR_NO_HOST TMR_ERROR_COMM(2)
00182 #define TMR_ERROR_LLRP TMR_ERROR_COMM(3)
00183 #define TMR_ERROR_PARSE TMR_ERROR_COMM(4)
00184 #define TMR_ERROR_DEVICE_RESET TMR_ERROR_COMM(5)
00185 #define TMR_ERROR_CRC_ERROR TMR_ERROR_COMM(6)
00186
00187 #define TMR_ERROR_MISC(x) TMR_STATUS_MAKE(TMR_ERROR_TYPE_MISC, (x))
00188 #define TMR_ERROR_INVALID TMR_ERROR_MISC(1)
00189 #define TMR_ERROR_UNIMPLEMENTED TMR_ERROR_MISC(2)
00190 #define TMR_ERROR_UNSUPPORTED TMR_ERROR_MISC(3)
00191 #define TMR_ERROR_NO_ANTENNA TMR_ERROR_MISC(4)
00192 #define TMR_ERROR_READONLY TMR_ERROR_MISC(5)
00193 #define TMR_ERROR_TOO_BIG TMR_ERROR_MISC(6)
00194 #define TMR_ERROR_NO_THREADS TMR_ERROR_MISC(7)
00195 #define TMR_ERROR_NO_TAGS TMR_ERROR_MISC(8)
00196 #define TMR_ERROR_NOT_FOUND TMR_ERROR_MISC(9)
00197 #define TMR_ERROR_FIRMWARE_FORMAT TMR_ERROR_MISC(10)
00198 #define TMR_ERROR_TRYAGAIN TMR_ERROR_MISC(11)
00199 #define TMR_ERROR_OUT_OF_MEMORY TMR_ERROR_MISC(12)
00200 #define TMR_ERROR_INVALID_WRITE_MODE TMR_ERROR_MISC(13)
00201 #define TMR_ERROR_ILLEGAL_VALUE TMR_ERROR_MISC(14)
00202 #define TMR_ERROR_END_OF_READING TMR_ERROR_MISC(15)
00203 #define TMR_ERROR_UNSUPPORTED_READER_TYPE TMR_ERROR_MISC(16)
00204 #define TMR_ERROR_BUFFER_OVERFLOW TMR_ERROR_MISC(17)
00205 #define TMR_ERROR_LOADSAVE_CONFIG TMR_ERROR_MISC(18)
00206 #define TMR_ERROR_AUTOREAD_ENABLED TMR_ERROR_MISC(19)
00207 #define TMR_ERROR_FIRMWARE_UPDATE_ON_AUTOREAD TMR_ERROR_MISC(20)
00208 #define TMR_ERROR_TIMESTAMP_NULL TMR_ERROR_MISC(21)
00209
00210
00211 #define TMR_ERROR_LLRP_SPECIFIC(x) TMR_STATUS_MAKE(TMR_ERROR_TYPE_LLRP, (x))
00212 #define TMR_ERROR_IS_LLRP_SPECIFIC(x) (TMR_ERROR_TYPE_LLRP == TMR_STATUS_GET_TYPE(x))
00213 #define TMR_ERROR_LLRP_GETTYPEREGISTRY TMR_ERROR_LLRP_SPECIFIC(1)
00214 #define TMR_ERROR_LLRP_CONNECTIONFAILED TMR_ERROR_LLRP_SPECIFIC(2)
00215 #define TMR_ERROR_LLRP_SENDIO_ERROR TMR_ERROR_LLRP_SPECIFIC(3)
00216 #define TMR_ERROR_LLRP_RECEIVEIO_ERROR TMR_ERROR_LLRP_SPECIFIC(4)
00217 #define TMR_ERROR_LLRP_RECEIVE_TIMEOUT TMR_ERROR_LLRP_SPECIFIC(5)
00218 #define TMR_ERROR_LLRP_MSG_PARSE_ERROR TMR_ERROR_LLRP_SPECIFIC(6)
00219 #define TMR_ERROR_LLRP_ALREADY_CONNECTED TMR_ERROR_LLRP_SPECIFIC(7)
00220 #define TMR_ERROR_LLRP_INVALID_RFMODE TMR_ERROR_LLRP_SPECIFIC(8)
00221 #define TMR_ERROR_LLRP_UNDEFINED_VALUE TMR_ERROR_LLRP_SPECIFIC(9)
00222 #define TMR_ERROR_LLRP_READER_ERROR TMR_ERROR_LLRP_SPECIFIC(10)
00223 #define TMR_ERROR_LLRP_READER_CONNECTION_LOST TMR_ERROR_LLRP_SPECIFIC(11)
00224
00225 #ifdef TMR_ENABLE_ERROR_STRINGS
00226 const char *TMR_strerror(TMR_Status status);
00227 #endif
00228
00229 #ifdef __cplusplus
00230 }
00231 #endif
00232
00233 #endif