10000 extmod/btstack/modbluetooth_btstack: Add default services. · micropython/micropython@67fb0be · GitHub
[go: up one dir, main page]

Skip to content

Commit 67fb0be

Browse files
committed
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>
1 parent a42a802 commit 67fb0be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

extmod/btstack/modbluetooth_btstack.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,13 @@ int mp_bluetooth_init(void) {
693693
gatt_client_listen_for_characteristic_value_updates(&MP_STATE_PORT(bluetooth_btstack_root_pointers)->notification, &btstack_packet_handler_generic, GATT_CLIENT_ANY_CONNECTION, NULL);
694694
#endif // MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT
695695

696+
// Always include at least the standard GAP and GATT default services. A
697+
// peripheral (likely a server) will almost always override this with its
698+
// own services, but a central should get the default services, e.g. so
699+
// the remote end can find out its GAP name.
700+
mp_bluetooth_gatts_register_service_begin(false);
701+
mp_bluetooth_gatts_register_service_end();
702+
696703
return 0;
697704
}
698705

0 commit comments

Comments
 (0)
0