Skip to content

Commit

Permalink
Update adapter.c
Browse files Browse the repository at this point in the history
bt_mesh_gatts_service_stop函数uuid赋值方式不对,当开启编译优化时uuid无法正确赋值
  • Loading branch information
ltmopen authored Oct 28, 2024
1 parent bfa1dfb commit d56f94c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/bt/esp_ble_mesh/core/nimble_host/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,16 +1309,18 @@ int bt_mesh_gatts_service_stop(struct bt_mesh_gatt_service *svc)
{
int rc;
uint16_t handle;

if (!svc) {
BT_ERR("%s, Invalid parameter", __func__);
return -EINVAL;
}

if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
const ble_uuid_t *uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
rc = ble_gatts_find_svc(uuid, &handle);
} else {
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
const ble_uuid_t *uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
rc = ble_gatts_find_svc(uuid, &handle);
}

assert(rc == 0);
Expand Down

0 comments on commit d56f94c

Please sign in to comment.