mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-11-06 04:22:49 +00:00
mesh: Fix redundant model publication clearing
If the model publication is not enabled, we should return success, however no other steps need to be done. This also helps avoid writing redundant entries to flash when resetting a node that never had model publication enabled.
This commit is contained in:
@@ -257,6 +257,10 @@ static u8_t _mod_pub_set(struct bt_mesh_model *model, u16_t pub_addr,
|
||||
}
|
||||
|
||||
if (pub_addr == BT_MESH_ADDR_UNASSIGNED) {
|
||||
if (model->pub->addr == BT_MESH_ADDR_UNASSIGNED) {
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
model->pub->addr = BT_MESH_ADDR_UNASSIGNED;
|
||||
model->pub->key = 0;
|
||||
model->pub->cred = 0;
|
||||
|
||||
Reference in New Issue
Block a user