30#include "nimble/nimble/include/nimble/hci_common.h"
32#include "ble_eddystone.h"
35#include "ble_hs_adv.h"
37#include "ble_hs_hci.h"
38#include "ble_hs_log.h"
39#include "ble_hs_mbuf.h"
40#include "ble_hs_stop.h"
41#include "ble_ibeacon.h"
46#include "nimble/nimble/include/nimble/nimble_npl.h"
47#include "ble_esp_hs.h"
53#define BLE_HS_FOREVER INT32_MAX
56#define BLE_HS_CONN_HANDLE_NONE 0xffff
58#define BLE_HS_CTRL_DATA_HDR_SZ 0x4
70#define BLE_HS_EAGAIN 1
71#define BLE_HS_EALREADY 2
72#define BLE_HS_EINVAL 3
73#define BLE_HS_EMSGSIZE 4
74#define BLE_HS_ENOENT 5
75#define BLE_HS_ENOMEM 6
76#define BLE_HS_ENOTCONN 7
77#define BLE_HS_ENOTSUP 8
79#define BLE_HS_EBADDATA 10
81#define BLE_HS_ECONTROLLER 12
82#define BLE_HS_ETIMEOUT 13
83#define BLE_HS_EDONE 14
84#define BLE_HS_EBUSY 15
85#define BLE_HS_EREJECT 16
86#define BLE_HS_EUNKNOWN 17
87#define BLE_HS_EROLE 18
88#define BLE_HS_ETIMEOUT_HCI 19
89#define BLE_HS_ENOMEM_EVT 20
90#define BLE_HS_ENOADDR 21
91#define BLE_HS_ENOTSYNCED 22
92#define BLE_HS_EAUTHEN 23
93#define BLE_HS_EAUTHOR 24
94#define BLE_HS_EENCRYPT 25
95#define BLE_HS_EENCRYPT_KEY_SZ 26
96#define BLE_HS_ESTORE_CAP 27
97#define BLE_HS_ESTORE_FAIL 28
98#define BLE_HS_EPREEMPTED 29
99#define BLE_HS_EDISABLED 30
100#define BLE_HS_ESTALLED 31
103#define BLE_HS_ERR_ATT_BASE 0x100
106#define BLE_HS_ATT_ERR(x) ((x) ? BLE_HS_ERR_ATT_BASE + (x) : 0)
109#define BLE_HS_ERR_HCI_BASE 0x200
112#define BLE_HS_HCI_ERR(x) ((x) ? BLE_HS_ERR_HCI_BASE + (x) : 0)
115#define BLE_HS_ERR_L2C_BASE 0x300
118#define BLE_HS_L2C_ERR(x) ((x) ? BLE_HS_ERR_L2C_BASE + (x) : 0)
121#define BLE_HS_ERR_SM_US_BASE 0x400
124#define BLE_HS_SM_US_ERR(x) ((x) ? BLE_HS_ERR_SM_US_BASE + (x) : 0)
127#define BLE_HS_ERR_SM_PEER_BASE 0x500
130#define BLE_HS_SM_PEER_ERR(x) ((x) ? BLE_HS_ERR_SM_PEER_BASE + (x) : 0)
133#define BLE_HS_ERR_HW_BASE 0x600
136#define BLE_HS_HW_ERR(x) (BLE_HS_ERR_HW_BASE + (x))
157#define BLE_HS_IO_DISPLAY_ONLY 0x00
160#define BLE_HS_IO_DISPLAY_YESNO 0x01
163#define BLE_HS_IO_KEYBOARD_ONLY 0x02
166#define BLE_HS_IO_NO_INPUT_OUTPUT 0x03
169#define BLE_HS_IO_KEYBOARD_DISPLAY 0x04
void ble_hs_sync_fn(void)
Stack sync callback.
Definition ble_hs.h:183
void ble_hs_reset_fn(int reason)
Stack reset callback.
Definition ble_hs.h:179
void ble_hs_sched_start(void)
Definition ble_hs.c:508
int ble_hs_start(void)
Definition ble_hs.c:639
void ble_hs_sched_reset(int reason)
Definition ble_hs.c:624
void ble_hs_init(void)
Definition ble_hs.c:735
int ble_hs_synced(void)
Definition ble_hs.c:339
int ble_hs_shutdown(int reason)
Called when the system is shutting down. Stops the BLE host.
void ble_hs_evq_set(struct ble_npl_eventq *evq)
Definition ble_hs.c:127
int ble_hs_is_enabled(void)
Indicates whether the host is enabled. The host is enabled if it is starting or fully started....
Definition ble_hs.c:333
Bluetooth Host main configuration structure.
Definition ble_hs.h:193
ble_store_delete_fn * store_delete_cb
Definition ble_hs.h:273
unsigned sm_oob_data_flag
Security Manager OOB flag.
Definition ble_hs.h:213
void * gatts_register_arg
Definition ble_hs.h:204
uint8_t sm_their_key_dist
Security Manager Remote Key Distribution Mask.
Definition ble_hs.h:247
ble_gatt_register_fn * gatts_register_cb
Definition ble_hs.h:198
ble_store_write_fn * store_write_cb
Definition ble_hs.h:270
unsigned sm_mitm
Security Manager MITM flag.
Definition ble_hs.h:227
unsigned sm_keypress
Security Manager Key Press Notification flag.
Definition ble_hs.h:241
uint8_t sm_io_cap
Definition ble_hs.h:207
unsigned sm_sc
Security Manager Secure Connections flag.
Definition ble_hs.h:235
uint8_t sm_our_key_dist
Security Manager Local Key Distribution Mask.
Definition ble_hs.h:244
ble_hs_reset_fn * reset_cb
Stack reset callback.
Definition ble_hs.h:254
ble_store_status_fn * store_status_cb
Storage Status callback.
Definition ble_hs.h:283
unsigned sm_bonding
Security Manager Bond flag.
Definition ble_hs.h:220
ble_hs_sync_fn * sync_cb
Stack sync callback.
Definition ble_hs.h:261
void * store_status_arg
Definition ble_hs.h:286
ble_store_read_fn * store_read_cb
Definition ble_hs.h:267