Bluetooth: Mesh: Fix publish timer handling when sending fails
Sending a model publication message could fail e.g. if there are no buffers available, however this doesn't mean that we should stop doing periodic publishing indefinitely. When an error occurs, make sure to call the publish_sent() function so that the periodic publishing timer gets resubmitted if necessary. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
e5b8f60bb6
commit
9abce3ec58
1 changed files with 3 additions and 0 deletions
|
@ -706,7 +706,10 @@ int bt_mesh_model_publish(struct bt_mesh_model *model)
|
|||
|
||||
err = model_send(model, &tx, true, &sdu, &pub_sent_cb, model);
|
||||
if (err) {
|
||||
/* Don't try retransmissions for this publish attempt */
|
||||
pub->count = 0;
|
||||
/* Make sure the publish timer gets reset */
|
||||
publish_sent(err, model);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue