mirror of
https://github.com/espressif/esp-idf
synced 2025-03-13 02:59:13 -04:00
ble_mesh: Client model check timer remaining time
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.
This commit is contained in:
parent
83813f830d
commit
bf712e4f91
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user