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>
pull/11239/head
Jim Mussared 2023-04-13 11:36:42 +10:00
rodzic a42a8022d8
commit 67fb0beddb
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -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;
}