2121#ifndef H_BLECENT_
2222#define H_BLECENT_
2323
24+ /****************************************************************************
25+ * Included Files
26+ ****************************************************************************/
27+
2428#include <stdio.h>
2529
2630#ifdef __cplusplus
27- extern "C" {
31+ extern "C"
32+ {
2833#endif
2934
3035struct ble_hs_adv_fields ;
@@ -40,30 +45,35 @@ union ble_store_key;
4045#define BLECENT_CHR_UNR_ALERT_STAT_UUID 0x2A45
4146#define BLECENT_CHR_ALERT_NOT_CTRL_PT 0x2A44
4247
43- /** Misc. */
48+ /* Misc. */
49+
4450void print_bytes (const uint8_t * bytes , int len );
4551void print_mbuf (const struct os_mbuf * om );
4652char * addr_str (const void * addr );
4753void print_uuid (const ble_uuid_t * uuid );
4854void print_conn_desc (const struct ble_gap_conn_desc * desc );
4955void print_adv_fields (const struct ble_hs_adv_fields * fields );
5056
51- /** Peer. */
52- struct peer_dsc {
57+ /* Peer. */
58+
59+ struct peer_dsc
60+ {
5361 SLIST_ENTRY (peer_dsc ) next ;
5462 struct ble_gatt_dsc dsc ;
5563};
5664SLIST_HEAD (peer_dsc_list , peer_dsc );
5765
58- struct peer_chr {
66+ struct peer_chr
67+ {
5968 SLIST_ENTRY (peer_chr ) next ;
6069 struct ble_gatt_chr chr ;
6170
6271 struct peer_dsc_list dscs ;
6372};
6473SLIST_HEAD (peer_chr_list , peer_chr );
6574
66- struct peer_svc {
75+ struct peer_svc
76+ {
6777 SLIST_ENTRY (peer_svc ) next ;
6878 struct ble_gatt_svc svc ;
6979
@@ -74,19 +84,23 @@ SLIST_HEAD(peer_svc_list, peer_svc);
7484struct peer ;
7585typedef void peer_disc_fn (const struct peer * peer , int status , void * arg );
7686
77- struct peer {
87+ struct peer
88+ {
7889 SLIST_ENTRY (peer ) next ;
7990
8091 uint16_t conn_handle ;
8192
82- /** List of discovered GATT services. */
93+ /* List of discovered GATT services. */
94+
8395 struct peer_svc_list svcs ;
8496
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+
8699 uint16_t disc_prev_chr_val ;
87100 struct peer_svc * cur_svc ;
88101
89- /** Callback that gets executed when service discovery completes. */
102+ /* Callback that gets executed when service discovery completes. */
103+
90104 peer_disc_fn * disc_cb ;
91105 void * disc_cb_arg ;
92106};
0 commit comments