Bluetooth: 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. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
310320c4d1
commit
f23e808ed0
1 changed files with 4 additions and 0 deletions
|
@ -260,6 +260,10 @@ static u8_t _mod_pub_set(struct bt_mesh_model *model, u16_t pub_addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pub_addr == BT_MESH_ADDR_UNASSIGNED) {
|
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->addr = BT_MESH_ADDR_UNASSIGNED;
|
||||||
model->pub->key = 0;
|
model->pub->key = 0;
|
||||||
model->pub->cred = 0;
|
model->pub->cred = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue