mesh: set delayed timer for periodic publish before publishing

Encrypting and sending a message takes a considerable amount of time
which makes the publication period longer than expected.

With this patch it is possible to pass MESH/SR/HM/CFS/BV-02-C test.

X-Original-Commit: bd394afb2112eb32b3e436bbc9e25cedcfd3649a
This commit is contained in:
Michał Narajowski
2017-09-21 15:01:18 +02:00
parent 2e17024333
commit 810eb2e03a
+4 -4
View File
@@ -98,15 +98,15 @@ static void mod_publish(struct os_event *work)
BT_DBG("");
if (pub->func) {
pub->func(pub->mod);
}
period_ms = bt_mesh_model_pub_period_get(pub->mod);
BT_DBG("period %u ms", period_ms);
if (period_ms) {
k_delayed_work_submit(&pub->timer, period_ms);
}
if (pub->func) {
pub->func(pub->mod);
}
}
static void mod_init(struct bt_mesh_model *mod, struct bt_mesh_elem *elem,