From 7cf84d52b92dbef43126f6dcfaef27f841b4620a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Wed, 30 Jan 2019 15:52:39 +0100 Subject: [PATCH] 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. --- nimble/host/mesh/src/access.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nimble/host/mesh/src/access.c b/nimble/host/mesh/src/access.c index 40ac67bf8..a6a12316b 100644 --- a/nimble/host/mesh/src/access.c +++ b/nimble/host/mesh/src/access.c @@ -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: