ble_mesh: Continue node info restore even if failure happens

During BLE Mesh Provisioner initialization, the stack will restore
the nodes information if settings storage is enabled.
Previously when a failure happens (e.g. found the same uuid) during
the restore procedure, the information of the following nodes will
not be restored and error will be directly returned.
But this will introduce some problem with user experience, because
some newly provisioned nodes information will not be restored and
Provisioner will not be able to control those nodes.
So we change the operation here, when a failure happens during the
restore procedure, Provisioner will only ignore the information of
the current node and continue restoring other nodes information.
This commit is contained in:
lly 2020-03-28 16:03:46 +08:00 committed by bot
parent eabf436a23
commit eedaf45f43

View file

@ -1150,13 +1150,13 @@ static int p_node_set(const char *name)
u16_t addr = net_buf_simple_pull_le16(buf);
if (!BLE_MESH_ADDR_IS_UNICAST(addr)) {
BT_ERR("%s, 0x%04x is not a unicast address", __func__, addr);
goto free;
continue;
}
err = node_info_set(addr, &exist);
if (err) {
BT_ERR("%s, Failed to load node 0x%04x info", __func__, addr);
goto free;
continue;
}
if (exist == false) {
@ -1166,17 +1166,16 @@ static int p_node_set(const char *name)
err = node_name_set(addr);
if (err) {
BT_ERR("%s, Failed to load node 0x%04x name", __func__, addr);
goto free;
continue;
}
err = node_comp_data_set(addr);
if (err) {
BT_ERR("%s, Failed to load node 0x%04x comp data", __func__, addr);
goto free;
continue;
}
}
free:
bt_mesh_free_buf(buf);
return err;
}