Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble blemesh adapter.c (IDFGH-13965) #14796

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 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 All @@ -1334,16 +1336,16 @@ int bt_mesh_gatts_service_start(struct bt_mesh_gatt_service *svc)
{
int rc;
uint16_t handle;

// const ble_uuid_t *uuid;
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);
ble_gatts_svc_set_visibility(handle, 1);

/* FIXME: figure out end handle */
ble_svc_gatt_changed(handle, 0xffff);

Expand Down