summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/modbluetooth.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2019-10-21 22:35:58 +1100
committerJim Mussared <jim.mussared@gmail.com>2019-10-22 14:30:23 +1100
commitf34e16dbc6648a46590501bbc5e4b146bd032eef (patch)
tree07a0b4b502452d40935de573965f9edf38d1db72 /extmod/modbluetooth.c
parentc7ae8c5a99fa463dea23c34e0bd70e71dfc118b9 (diff)
downloadmicropython-f34e16dbc6648a46590501bbc5e4b146bd032eef.tar.gz
micropython-f34e16dbc6648a46590501bbc5e4b146bd032eef.zip
extmod/modbluetooth: Persist reference to NimBLE service instances.
NimBLE doesn't actually copy this data, it requires it to stay live. Only dereference when we register a new set of services. Fixes #5226 This will allow incrementally adding services in the future, so rename `reset` to `append` to make it clearer.
Diffstat (limited to 'extmod/modbluetooth.c')
-rw-r--r--extmod/modbluetooth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 1b98888448..2a3e87bc24 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -421,9 +421,9 @@ STATIC mp_obj_t bluetooth_ble_gatts_register_services(mp_obj_t self_in, mp_obj_t
uint16_t **handles = m_new0(uint16_t*, len);
size_t *num_handles = m_new0(size_t, len);
- // We always reset the service list, as Nimble has no other option.
- // TODO: Add a `reset` or `clear` kwarg (defaulting to True) to make this behavior optional.
- int err = mp_bluetooth_gatts_register_service_begin(true);
+ // TODO: Add a `append` kwarg (defaulting to False) to make this behavior optional.
+ bool append = false;
+ int err = mp_bluetooth_gatts_register_service_begin(append);
if (err != 0) {
return bluetooth_handle_errno(err);
}