diff options
author | jp-96 <h.kuroyanagi.css@gmail.com> | 2020-06-08 12:19:56 +0900 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-06-10 22:33:29 +1000 |
commit | 3705bc418cadd9d6ad87f2bcd5443ba82f730e15 (patch) | |
tree | e73862ef71c327d1179d4e0b41d2f5b07ad0cc6e /extmod/nimble/modbluetooth_nimble.c | |
parent | a4c96fb3b0c5e3bf83238a0edd0fbcbfd96208c8 (diff) |
extmod/modbluetooth: Register default GATT service and fix esp32 init.
This is for the NimBLE bindings, to make sure the default GATT service
appears and that the esp32 initialises NimBLE correctly (it now matches
stm32).
Diffstat (limited to 'extmod/nimble/modbluetooth_nimble.c')
-rw-r--r-- | extmod/nimble/modbluetooth_nimble.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c index 05ec61177..035ec3d26 100644 --- a/extmod/nimble/modbluetooth_nimble.c +++ b/extmod/nimble/modbluetooth_nimble.c @@ -39,6 +39,7 @@ #include "nimble/ble.h" #include "nimble/nimble_port.h" #include "services/gap/ble_svc_gap.h" +#include "services/gatt/ble_svc_gatt.h" #ifndef MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME #define MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME "MPY NIMBLE" @@ -271,8 +272,9 @@ int mp_bluetooth_init(void) { nimble_port_init(); mp_bluetooth_nimble_port_postinit(); - // By default, just register the default gap service. + // By default, just register the default gap/gatt service. ble_svc_gap_init(); + ble_svc_gatt_init(); mp_bluetooth_nimble_port_start(); @@ -466,8 +468,9 @@ int mp_bluetooth_gatts_register_service_begin(bool append) { // Reset the gatt characteristic value db. mp_bluetooth_gatts_db_reset(MP_STATE_PORT(bluetooth_nimble_root_pointers)->gatts_db); - // By default, just register the default gap service. + // By default, just register the default gap/gatt service. ble_svc_gap_init(); + ble_svc_gatt_init(); if (!append) { // Unref any previous service definitions. |