nimble_autoadv.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
28 #ifndef NIMBLE_AUTOADV_H
29 #define NIMBLE_AUTOADV_H
30 
31 #include "host/ble_gap.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
42 #ifndef NIMBLE_AUTOADV_DEVICE_NAME
43  #define NIMBLE_AUTOADV_DEVICE_NAME NULL
44 #endif
45 
55 #ifndef NIMBLE_AUTOADV_START_MANUALLY
56  #define NIMBLE_AUTOADV_START_MANUALLY 0
57 #endif
58 
62 void nimble_autoadv_init(void);
63 
72 void nimble_autoadv_set_ble_gap_adv_params(struct ble_gap_adv_params *params);
73 
86 int nimble_autoadv_add_field(uint8_t type, const void *data, size_t data_len);
87 
95 void nimble_auto_adv_set_adv_duration(int32_t duration_ms);
96 
111 void nimble_auto_adv_set_gap_cb(ble_gap_event_fn *cb, void *cb_arg);
112 
120 void nimble_autoadv_start(void);
121 
126 void nimble_autoadv_stop(void);
127 
136 void nimble_autoadv_reset(void);
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* NIMBLE_AUTOADV_H */
nimble_autoadv_add_field
int nimble_autoadv_add_field(uint8_t type, const void *data, size_t data_len)
Add a new field to the given advertising data.
nimble_autoadv_set_ble_gap_adv_params
void nimble_autoadv_set_ble_gap_adv_params(struct ble_gap_adv_params *params)
Set struct for additional arguments specifying the particulars of the advertising procedure.
nimble_autoadv_reset
void nimble_autoadv_reset(void)
Reset all data regarding the advertising process.
nimble_auto_adv_set_adv_duration
void nimble_auto_adv_set_adv_duration(int32_t duration_ms)
Set the duration for the advertising procedure.
nimble_autoadv_init
void nimble_autoadv_init(void)
Initialize autoadv module.
nimble_autoadv_start
void nimble_autoadv_start(void)
Start the automated advertising procedure.
nimble_auto_adv_set_gap_cb
void nimble_auto_adv_set_gap_cb(ble_gap_event_fn *cb, void *cb_arg)
Set the callback for gap events.
nimble_autoadv_stop
void nimble_autoadv_stop(void)
Stop the automated advertising procedure.