Before handling status message, client models need check if the corresponding timer has expired. And if timeout happens, the status message will be treated as a publish message.
@@ -173,6 +173,7 @@ int k_delayed_work_free(struct k_delayed_work *work)
return -EINVAL;
}
+ osi_alarm_cancel(alarm);
hash_map_erase(bm_alarm_hash_map, work);
return 0;
@@ -103,6 +103,14 @@ bt_mesh_client_node_t *bt_mesh_is_client_recv_publish_msg(
return NULL;
+ if (k_delayed_work_remaining_get(&node->timer) == 0) {
+ BT_DBG("Unexpected status message 0x%x", ctx->recv_op);
+ if (cli->publish_status && need_pub) {
+ cli->publish_status(ctx->recv_op, model, ctx, buf);
+ }
+ return NULL;
+
return node;