Skip to content

Commit a2ddf99

Browse files
aurel32jhedberg
authored andcommitted
Bluetooth: Mesh: fix next_period computation
If the duration to publish is roughly the same as the period, we might end up with elapsed == period, which returns 0 and cancel the periodic publication. Instead 1 should be returned, just like when the elapsed time is greater than the period. Signed-off-by: Aurelien Jarno <[email protected]>
1 parent cdb6332 commit a2ddf99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/bluetooth/mesh/access.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static s32_t next_period(struct bt_mesh_model *mod)
105105

106106
BT_DBG("Publishing took %ums", elapsed);
107107

108-
if (elapsed > period) {
108+
if (elapsed >= period) {
109109
BT_WARN("Publication sending took longer than the period");
110110
/* Return smallest positive number since 0 means disabled */
111111
return K_MSEC(1);

0 commit comments

Comments
 (0)