client-c  0.8.1
kaa_common.h
Go to the documentation of this file.
1 
22 #ifndef KAA_COMMON_H_
23 #define KAA_COMMON_H_
24 
25 #include "kaa_error.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 /*
33  * Standard error handling macros
34  */
35 #define KAA_RETURN_IF_ERR(E) \
36  do { if (E) return E; } while (0)
37 
38 #define KAA_RETURN_IF_NIL(p, E) \
39  do { if (!(p)) return E; } while (0)
40 
41 #define KAA_RETURN_IF_NIL2(p1, p2, E) \
42  do { if (!(p1) || !(p2)) return E; } while (0)
43 
44 #define KAA_RETURN_IF_NIL3(p1, p2, p3, E) \
45  do { if (!(p1) || !(p2) || !(p3)) return E; } while (0)
46 
47 #define KAA_RETURN_IF_NIL4(p1, p2, p3, p4, E) \
48  do { if (!(p1) || !(p2) || !(p3) || !(p4)) return E; } while (0)
49 
50 #define KAA_RETURN_IF_NIL5(p1, p2, p3, p4, p5,E) \
51  do { if (!(p1) || !(p2) || !(p3) || !(p4) || !(p5)) return E; } while (0)
52 
53 
57 typedef enum {
66 
70 typedef struct {
71  uint32_t id;
72  uint16_t version;
74 
76 {
77  return first && second && first->id == second->id && first->version == second->version;
78 }
79 
84 typedef struct {
85  uint32_t id;
89 
90 /*
91  * Endpoint ID
92  */
93 #define KAA_ENDPOINT_ID_LENGTH 20
95 typedef const uint8_t *kaa_endpoint_id_p;
96 
97 
98 
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102 #endif /* KAA_COMMON_H_ */
uint8_t kaa_endpoint_id[KAA_ENDPOINT_ID_LENGTH]
Definition: kaa_common.h:94
static int kaa_transport_protocol_id_equals(const kaa_transport_protocol_id_t *first, const kaa_transport_protocol_id_t *second)
Definition: kaa_common.h:75
#define KAA_ENDPOINT_ID_LENGTH
Definition: kaa_common.h:93
Identifier used to uniquely represent transport protocol.
Definition: kaa_common.h:70
kaa_service_t
Types of Kaa platform services.
Definition: kaa_common.h:57
Kaa error codes.
uint16_t connection_data_len
Definition: kaa_common.h:86
const uint8_t * kaa_endpoint_id_p
Definition: kaa_common.h:95
char * connection_data
Definition: kaa_common.h:87
Connection parameters used by transport channels to establish connection both to Bootstrap and Operat...
Definition: kaa_common.h:84