BLE Handling

This commit is contained in:
2026-01-12 15:10:54 +01:00
parent c13b6d73c9
commit 395d577b78
5 changed files with 110 additions and 96 deletions

View File

@@ -105,11 +105,8 @@ static ssize_t write_lasertag_val(struct bt_conn *conn, const struct bt_gatt_att
if (bt_uuid_cmp(attr->uuid, BT_UUID_LT_PROV_NAME_CHAR) == 0)
{
rc = lasertag_set_device_name(buf, len);
if (rc == 0 && adv_enabled) {
LOG_INF("Stopping advertising to update device name");
ble_mgmt_adv_stop();
LOG_INF("Restarting advertising with new device name");
ble_mgmt_adv_start();
if (rc == 0 ) {
bt_set_name(lasertag_get_device_name());
}
}
else if (bt_uuid_cmp(attr->uuid, BT_UUID_LT_PROV_PANID_CHAR) == 0)