mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-19 03:22:07 +00:00
nimble WIP turn on bonding and security
This commit is contained in:
parent
b6a3deb341
commit
00cf3a768e
@ -738,21 +738,11 @@ void reinitBluetooth()
|
|||||||
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
|
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
|
||||||
|
|
||||||
ble_hs_cfg.sm_io_cap = BLE_SM_IO_CAP_DISP_ONLY;
|
ble_hs_cfg.sm_io_cap = BLE_SM_IO_CAP_DISP_ONLY;
|
||||||
#ifdef CONFIG_EXAMPLE_BONDING
|
|
||||||
ble_hs_cfg.sm_bonding = 1;
|
ble_hs_cfg.sm_bonding = 1;
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_EXAMPLE_MITM
|
|
||||||
ble_hs_cfg.sm_mitm = 1;
|
ble_hs_cfg.sm_mitm = 1;
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_EXAMPLE_USE_SC
|
|
||||||
ble_hs_cfg.sm_sc = 1;
|
ble_hs_cfg.sm_sc = 1;
|
||||||
#else
|
|
||||||
ble_hs_cfg.sm_sc = 0;
|
|
||||||
#ifdef CONFIG_EXAMPLE_BONDING
|
|
||||||
ble_hs_cfg.sm_our_key_dist = 1;
|
ble_hs_cfg.sm_our_key_dist = 1;
|
||||||
ble_hs_cfg.sm_their_key_dist = 1;
|
ble_hs_cfg.sm_their_key_dist = 1;
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// add standard GAP services
|
// add standard GAP services
|
||||||
ble_svc_gap_init();
|
ble_svc_gap_init();
|
||||||
|
@ -32,17 +32,17 @@ const struct ble_gatt_svc_def gatt_svr_svcs[] = {
|
|||||||
// FIXME - remove non ENC access
|
// FIXME - remove non ENC access
|
||||||
.uuid = &toradio_uuid.u,
|
.uuid = &toradio_uuid.u,
|
||||||
.access_cb = toradio_callback,
|
.access_cb = toradio_callback,
|
||||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_ENC,
|
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_AUTHEN,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.uuid = &fromradio_uuid.u,
|
.uuid = &fromradio_uuid.u,
|
||||||
.access_cb = fromradio_callback,
|
.access_cb = fromradio_callback,
|
||||||
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC,
|
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_AUTHEN,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.uuid = &fromnum_uuid.u,
|
.uuid = &fromnum_uuid.u,
|
||||||
.access_cb = fromnum_callback,
|
.access_cb = fromnum_callback,
|
||||||
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC | BLE_GATT_CHR_F_NOTIFY,
|
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_AUTHEN | BLE_GATT_CHR_F_NOTIFY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
0, /* No more characteristics in this service. */
|
0, /* No more characteristics in this service. */
|
||||||
|
Loading…
Reference in New Issue
Block a user