mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-06 01:57:56 +00:00
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.
This commit is contained in:
@@ -721,7 +721,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);
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
Reference in New Issue
Block a user