Bluetooth: Mesh: fix proxy srv return value
Previously, `bt_mesh_proxy_gatt_enable` returned the return value from `k_work_schedule`, which could be a positive (non-error) message. Now, it only returns negative error codes (else 0). Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
This commit is contained in:
parent
0480367d77
commit
9285ea3238
|
@ -975,6 +975,8 @@ static void svc_reg_work_handler(struct k_work *work)
|
|||
|
||||
int bt_mesh_proxy_gatt_enable(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
LOG_DBG("");
|
||||
|
||||
if (!bt_mesh_is_provisioned()) {
|
||||
|
@ -986,7 +988,13 @@ int bt_mesh_proxy_gatt_enable(void)
|
|||
}
|
||||
|
||||
svc_reg_attempts = PROXY_SVC_REG_ATTEMPTS;
|
||||
return k_work_schedule(&svc_reg_work, PROXY_SVC_INIT_TIMEOUT);
|
||||
err = k_work_schedule(&svc_reg_work, PROXY_SVC_INIT_TIMEOUT);
|
||||
if (err < 0) {
|
||||
LOG_ERR("Enabling GATT proxy failed (err %d)", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bt_mesh_proxy_gatt_disconnect(void)
|
||||
|
|
Loading…
Reference in a new issue