Bluetooth: mesh: Convert bluetooth mesh to using k_timeout struct

Convert bluetooth mesh to using k_timeout struct. Many of the mesh
modules uses timeout calculations, so it is most practical to keep
the s32_t type and only initialize a k_timeout_t struct when
calling the kernel.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-04-06 13:56:14 +02:00 committed by Johan Hedberg
commit 87d9eadf50
20 changed files with 120 additions and 122 deletions

View file

@ -363,7 +363,7 @@ int bt_mesh_fault_update(struct bt_mesh_elem *elem)
/* Let periodic publishing, if enabled, take care of sending the
* Health Current Status.
*/
if (bt_mesh_model_pub_period_get(mod)) {
if (bt_mesh_model_pub_period_get(mod) > 0) {
return 0;
}
@ -435,12 +435,12 @@ void bt_mesh_attention(struct bt_mesh_model *model, u8_t time)
srv = model->user_data;
}
if (time) {
if (time > 0) {
if (srv->cb && srv->cb->attn_on) {
srv->cb->attn_on(model);
}
k_delayed_work_submit(&srv->attn_timer, time * 1000U);
k_delayed_work_submit(&srv->attn_timer, K_SECONDS(time));
} else {
k_delayed_work_cancel(&srv->attn_timer);