mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble mesh: stack: return error when scanning failed to be enabled(v5.1)
This commit is contained in:
parent
d83fe16c93
commit
d6c18ad4c5
@ -197,6 +197,8 @@ static bool prov_bearers_valid(bt_mesh_prov_bearer_t bearers)
|
|||||||
|
|
||||||
int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
|
int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
|
||||||
{
|
{
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
if (bt_mesh_is_provisioned()) {
|
if (bt_mesh_is_provisioned()) {
|
||||||
BT_WARN("%s, Already", __func__);
|
BT_WARN("%s, Already", __func__);
|
||||||
return -EALREADY;
|
return -EALREADY;
|
||||||
@ -232,7 +234,11 @@ int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
|
|||||||
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
|
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
|
||||||
(bearers & BLE_MESH_PROV_ADV)) {
|
(bearers & BLE_MESH_PROV_ADV)) {
|
||||||
/* Make sure we're scanning for provisioning invitations */
|
/* Make sure we're scanning for provisioning invitations */
|
||||||
bt_mesh_scan_enable();
|
err = bt_mesh_scan_enable();
|
||||||
|
if (err) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
/* Enable unprovisioned beacon sending */
|
/* Enable unprovisioned beacon sending */
|
||||||
bt_mesh_beacon_enable();
|
bt_mesh_beacon_enable();
|
||||||
}
|
}
|
||||||
@ -637,7 +643,10 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
|||||||
bt_mesh_beacon_enable();
|
bt_mesh_beacon_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_mesh_scan_enable();
|
err = bt_mesh_scan_enable();
|
||||||
|
if (err) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user