summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/btstack/modbluetooth_btstack.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-04-13 11:36:42 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-04-26 11:37:20 +1000
commit67fb0beddb4e05b3126635143eefb41a599d9460 (patch)
treee1aeed428dfa4c6ab82a44876526efcc6fc1fa95 /extmod/btstack/modbluetooth_btstack.c
parenta42a8022d8d2c9fc1fe05ff5ac60b650e481a62d (diff)
downloadmicropython-67fb0beddb4e05b3126635143eefb41a599d9460.tar.gz
micropython-67fb0beddb4e05b3126635143eefb41a599d9460.zip
extmod/btstack/modbluetooth_btstack: Add default services.
Even if the user doesn't call ble.gatts_register_services, always provide the default services. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/btstack/modbluetooth_btstack.c')
-rw-r--r--extmod/btstack/modbluetooth_btstack.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c
index b44e2aacbb..0e29c38efd 100644
--- a/extmod/btstack/modbluetooth_btstack.c
+++ b/extmod/btstack/modbluetooth_btstack.c
@@ -693,6 +693,13 @@ int mp_bluetooth_init(void) {
gatt_client_listen_for_characteristic_value_updates(&MP_STATE_PORT(bluetooth_btstack_root_pointers)->notification, &btstack_packet_handler_generic, GATT_CLIENT_ANY_CONNECTION, NULL);
#endif // MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT
+ // Always include at least the standard GAP and GATT default services. A
+ // peripheral (likely a server) will almost always override this with its
+ // own services, but a central should get the default services, e.g. so
+ // the remote end can find out its GAP name.
+ mp_bluetooth_gatts_register_service_begin(false);
+ mp_bluetooth_gatts_register_service_end();
+
return 0;
}