WE310F5  39.00.000
m2mb_status.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
23 #ifndef M2M_M2MB_STATUS_H
24 #define M2M_M2MB_STATUS_H
25 
26 /* Include files ================================================================================*/
27 #if !defined(NOT_STD_TYPE)
28 /* here could be included */
29 #include <stdint.h>
30 #endif
31 
42 /*-----------------------------------------------------------------------------------------------*/
43 
48 /*-----------------------------------------------------------------------------------------------*/
49 
50 /* Global declarations ==========================================================================*/
51 
52 /*
53  * The following definitions are used to format error codes based on their
54  * module. Error codes that use these macros will be a negative value of
55  * the format -((10000 * <Module ID>) + <Status Code>).
56  */
57 #define __M2MB_ERR_MOD_OFFSET (10000)
58 #define __M2MB_ERR_ENCAP_MOD_ID(__mod_id__) ((__mod_id__) * __M2MB_ERR_MOD_OFFSET)
59 #define __M2MB_ERROR(__mod_id__, __err__) (0 - (__M2MB_ERR_ENCAP_MOD_ID(__mod_id__) + (__err__)))
60 
61 /*
62  * The following definitions represent the IDs for the various modules of
63  * the M2MB.
64  *
65  * Note if the OEM wishes to add their own module IDs, it is recommended
66  * to start at 100 to avoid possible conflicts with updates to the M2MB
67  * that adds in additional modules.
68  */
69 #define M2MB_MOD_BASE (0)
70 #define M2MB_MOD_NETWORKING (2)
71 
72 /*
73  * The following definitions represent the status codes common to all of
74  * the M2MB modules.
75  */
76 #define M2MB_OK ((M2MB_STATUS_T)(0))
77 #define M2MB_ERROR ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 1)))
78 #define M2MB_ERR_INVALID_PARAM ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 2)))
79 #define M2MB_ERR_NO_MEMORY ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 3)))
80 #define M2MB_ERR_NO_RESOURCE ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 4)))
81 #define M2MB_ERR_BUSY ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 6)))
82 #define M2MB_ERR_NO_ENTRY ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 7)))
83 #define M2MB_ERR_NOT_SUPPORTED ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 8)))
84 #define M2MB_ERR_TIMEOUT ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 9)))
85 #define M2MB_ERR_BOUNDS ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 10)))
86 #define M2MB_ERR_BAD_PAYLOAD ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 11)))
87 #define M2MB_ERR_EXISTS ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 12)))
89 #define M2MB_CONTINUE ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 13)))
90 #define M2MB_IN_PROGRESS ((M2MB_STATUS_T)(__M2MB_ERROR(M2MB_MOD_BASE, 14)))
91 
92 
93 /* Global typedefs ==============================================================================*/
94 
95 
96 /* typedefs that defines status */
98 
99 #define M2MB_FRAGMENT_FIRST ( 1 << 0 )
100 #define M2MB_FRAGMENT_MIDDLE ( 1 << 1 )
101 #define M2MB_FRAGMENT_LAST ( 1 << 2 )
102 
103 
107 /*-----------------------------------------------------------------------------------------------*/
108 
109 #endif /* M2M_M2MB_STATUS_H */
INT32 M2MB_STATUS_T
Definition: m2mb_status.h:97
signed int INT32
Definition: m2mb_types.h:82