21
21
#ifndef H_BLECENT_
22
22
#define H_BLECENT_
23
23
24
+ /****************************************************************************
25
+ * Included Files
26
+ ****************************************************************************/
27
+
24
28
#include <stdio.h>
25
29
26
30
#ifdef __cplusplus
27
- extern "C" {
31
+ extern "C"
32
+ {
28
33
#endif
29
34
30
35
struct ble_hs_adv_fields ;
@@ -40,30 +45,35 @@ union ble_store_key;
40
45
#define BLECENT_CHR_UNR_ALERT_STAT_UUID 0x2A45
41
46
#define BLECENT_CHR_ALERT_NOT_CTRL_PT 0x2A44
42
47
43
- /** Misc. */
48
+ /* Misc. */
49
+
44
50
void print_bytes (const uint8_t * bytes , int len );
45
51
void print_mbuf (const struct os_mbuf * om );
46
52
char * addr_str (const void * addr );
47
53
void print_uuid (const ble_uuid_t * uuid );
48
54
void print_conn_desc (const struct ble_gap_conn_desc * desc );
49
55
void print_adv_fields (const struct ble_hs_adv_fields * fields );
50
56
51
- /** Peer. */
52
- struct peer_dsc {
57
+ /* Peer. */
58
+
59
+ struct peer_dsc
60
+ {
53
61
SLIST_ENTRY (peer_dsc ) next ;
54
62
struct ble_gatt_dsc dsc ;
55
63
};
56
64
SLIST_HEAD (peer_dsc_list , peer_dsc );
57
65
58
- struct peer_chr {
66
+ struct peer_chr
67
+ {
59
68
SLIST_ENTRY (peer_chr ) next ;
60
69
struct ble_gatt_chr chr ;
61
70
62
71
struct peer_dsc_list dscs ;
63
72
};
64
73
SLIST_HEAD (peer_chr_list , peer_chr );
65
74
66
- struct peer_svc {
75
+ struct peer_svc
76
+ {
67
77
SLIST_ENTRY (peer_svc ) next ;
68
78
struct ble_gatt_svc svc ;
69
79
@@ -74,19 +84,23 @@ SLIST_HEAD(peer_svc_list, peer_svc);
74
84
struct peer ;
75
85
typedef void peer_disc_fn (const struct peer * peer , int status , void * arg );
76
86
77
- struct peer {
87
+ struct peer
88
+ {
78
89
SLIST_ENTRY (peer ) next ;
79
90
80
91
uint16_t conn_handle ;
81
92
82
- /** List of discovered GATT services. */
93
+ /* List of discovered GATT services. */
94
+
83
95
struct peer_svc_list svcs ;
84
96
85
- /** Keeps track of where we are in the service discovery process. */
97
+ /* Keeps track of where we are in the service discovery process. */
98
+
86
99
uint16_t disc_prev_chr_val ;
87
100
struct peer_svc * cur_svc ;
88
101
89
- /** Callback that gets executed when service discovery completes. */
102
+ /* Callback that gets executed when service discovery completes. */
103
+
90
104
peer_disc_fn * disc_cb ;
91
105
void * disc_cb_arg ;
92
106
};
0 commit comments