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:
Michał Narajowski
2019-01-31 17:50:26 +01:00
parent d42c018ffb
commit 7cf84d52b9
+3
View File
@@ -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: