Skip to content

Commit bfa1dfb

Browse files
authored
Update adapter.c
源代码开启编译优化后uuid将不能被正确赋值,导致函数ble_gatts_find_svc执行失败。
1 parent a97a7b0 commit bfa1dfb

File tree

1 file changed

+5
-5
lines changed
  • components/bt/esp_ble_mesh/core/nimble_host

1 file changed

+5
-5
lines changed

components/bt/esp_ble_mesh/core/nimble_host/adapter.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1334,16 +1334,16 @@ int bt_mesh_gatts_service_start(struct bt_mesh_gatt_service *svc)
13341334
{
13351335
int rc;
13361336
uint16_t handle;
1337-
1337+
// const ble_uuid_t *uuid;
13381338
if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
1339-
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
1339+
const ble_uuid_t *uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
1340+
rc = ble_gatts_find_svc(uuid, &handle);
13401341
} else {
1341-
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
1342+
const ble_uuid_t *uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
1343+
rc = ble_gatts_find_svc(uuid, &handle);
13421344
}
1343-
13441345
assert(rc == 0);
13451346
ble_gatts_svc_set_visibility(handle, 1);
1346-
13471347
/* FIXME: figure out end handle */
13481348
ble_svc_gatt_changed(handle, 0xffff);
13491349

0 commit comments

Comments
 (0)