C API for BALTECH SDK
errorcodes.h
Go to the documentation of this file.
1 
12 #ifndef __ERRORCODES_H__
13 #define __ERRORCODES_H__
14 
15 
23 typedef unsigned int brp_errcode;
24 
25 
36 #define BRP_ERRMASK_GROUP 0xFFFF0000
37 #define BRP_ERRMASK_CODE 0x0000FFFF
38 
64 #define BRP_ERRGRP_DEVICE 0x00010000u
65 
66 
71 #define BRP_ERRGRP_COMM_UNSUPPORTED 0x00800000u
72 
73 
78 #define BRP_ERRGRP_COMM_ACCESSDENIED 0x01000000u
79 
80 
84 #define BRP_ERRGRP_COMM_TIMEOUT 0x02000000u
85 
86 
90 #define BRP_ERRGRP_COMM_FRAMEFORMAT 0x04000000u
91 
92 
97 #define BRP_ERRGRP_COMM_UNDEFINED 0x08000000u
98 
99 
103 #define BRP_ERRGRP_COMMUNICATION 0x0F800000u
104 
105 
109 #define BRP_ERRGRP_LIB_INVALIDCALL 0x10000000u
110 
111 
116 #define BRP_ERRGRP_LIB_NONRECOVERABLE 0x20000000u
117 
118 
122 #define BRP_ERRGRP_LIB_OS 0x40000000u
123 
124 
128 #define BRP_ERRGRP_LIB_UNDEFINED 0x80000000u
129 
130 
134 #define BRP_ERRGRP_LIBRARY 0xF0000000u
135 
155 #define BRP_OK 0x00000000u
156 
157 
162 #define BRP_ERR_INTERNAL (0x0001u | BRP_ERRGRP_LIB_NONRECOVERABLE)
163 
164 
171 #define BRP_ERR_CMD_TIMEOUT (0x0002u | BRP_ERRGRP_COMM_TIMEOUT)
172 
173 
178 #define BRP_ERR_FRAMEFORMAT (0x0003u | BRP_ERRGRP_COMM_FRAMEFORMAT)
179 
180 
185 #define BRP_ERR_INVALID_API_CALL (0x0004u | BRP_ERRGRP_LIB_INVALIDCALL)
186 
187 
192 #define BRP_ERR_OUT_OF_MEMORY (0x0005u | BRP_ERRGRP_LIB_NONRECOVERABLE)
193 
194 
198 #define BRP_ERR_NOT_IMPLEMENTED (0x0006u | BRP_ERRGRP_LIB_INVALIDCALL)
199 
200 
205 #define BRP_ERR_BUSY (0x0007u | BRP_ERRGRP_LIB_INVALIDCALL)
206 
207 
211 #define BRP_ERR_CLOSED (0x0008u | BRP_ERRGRP_LIB_INVALIDCALL)
212 
213 
217 #define BRP_ERR_BUFFER_OVERFLOW (0x0009u | BRP_ERRGRP_COMM_FRAMEFORMAT)
218 
219 
223 #define BRP_ERR_OPEN_IO (0x000Au | BRP_ERRGRP_LIB_OS)
224 
225 
229 #define BRP_ERR_WRITE_IO (0x000Bu | BRP_ERRGRP_LIB_OS)
230 
231 
235 #define BRP_ERR_WAIT_IO (0x000Cu | BRP_ERRGRP_LIB_OS)
236 
237 
241 #define BRP_ERR_READ_IO (0x000Du | BRP_ERRGRP_LIB_OS)
242 
243 
247 #define BRP_ERR_CLOSE_IO (0x000Eu | BRP_ERRGRP_LIB_OS)
248 
249 
253 #define BRP_ERR_PAYLOAD_FORMAT (0x000Fu | BRP_ERRGRP_COMM_FRAMEFORMAT)
254 
255 
260 #define BRP_ERR_CRYPTO_FORMAT (0x0010u | BRP_ERRGRP_COMM_FRAMEFORMAT)
261 #define BRP_ERR_PKI_FORMAT BRP_ERR_CRYPTO_FORMAT // legacy support
262 
263 
267 #define BRP_ERR_DEV_CERT_FORMAT (0x0011u | BRP_ERRGRP_COMM_FRAMEFORMAT)
268 
269 
280 #define BRP_ERR_HOST_CERT_FORMAT (0x00012u | BRP_ERRGRP_COMM_FRAMEFORMAT)
281 
282 
286 #define BRP_ERR_PKI_OPERATION_FAILED (0x0013u | BRP_ERRGRP_LIB_NONRECOVERABLE)
287 
288 
292 #define BRP_ERR_DEV_CERT_INVALID_SIGNATURE \
293  (0x0014u | BRP_ERRGRP_COMM_ACCESSDENIED)
294 
295 
300 #define BRP_ERR_HOST_CERT_INVALID_SIGNATURE \
301  (0x0015u | BRP_ERRGRP_COMM_ACCESSDENIED)
302 
303 
307 #define BRP_ERR_SEC_LEVEL_NOT_SUPPORTED \
308  (0x0016u | BRP_ERRGRP_COMM_ACCESSDENIED)
309 
310 
315 #define BRP_ERR_SEQ_CTR_NOT_IN_SYNC (0x0017u | BRP_ERRGRP_COMM_ACCESSDENIED)
316 
317 
322 #define BRP_ERR_INVALID_HMAC (0x0018u | BRP_ERRGRP_COMM_ACCESSDENIED)
323 
324 
328 #define BRP_ERR_CRYPTO_RECV_DEV (0x0019u | BRP_ERRGRP_COMM_ACCESSDENIED)
329 
330 
337 #define BRP_ERR_UNSUPPORTED_COMMAND (0x0020u | BRP_ERRGRP_COMM_UNSUPPORTED)
338 
339 
346 #define BRP_ERR_COMMAND_DENIED (0x0021u |BRP_ERRGRP_COMM_ACCESSDENIED)
347 
348 
353 #define BRP_ERR_UNEXPECTED_FRAME (0x0022u | BRP_ERRGRP_COMM_FRAMEFORMAT)
354 
355 
363 #define BRP_ERR_TIMEOUT (0x0023u | BRP_ERRGRP_COMM_TIMEOUT)
364 
365 
370 #define BRP_ERR_CALLED_INVALID_FRAME (0x0024u | BRP_ERRGRP_LIB_INVALIDCALL)
371 
372 
379 #define BRP_ERR_EXISTING_LAYER (0x0025u | BRP_ERRGRP_LIB_INVALIDCALL)
380 
381 
385 #define BRP_ERR_GEN_RANDOM_DATA (0x0026u | BRP_ERRGRP_LIB_OS)
386 
387 
391 #define BRP_ERR_INVALID_KEY (0x0027u | BRP_ERRGRP_COMM_ACCESSDENIED)
392 
393 
405 #define BRP_ERR_STATUS(cmd_code, statuscode) \
406  ((brp_errcode)(((cmd_code) & 0xFF00u) \
407  | ((statuscode) & 0xFFu) \
408  | BRP_ERRGRP_DEVICE))
409 
410 
411 
417 #endif
418  // end of defgroup brp_lib
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23