feat(ble_mesh): ignored the previous server status to avoid drop target by mistake

(cherry picked from commit bc2d56b72a)

Co-authored-by: luoxu <luoxu@espressif.com>
This commit is contained in:
Luo Xu
2026-02-09 17:43:22 +08:00
parent 118c7bd1b8
commit 8b1170e224

View File

@@ -1060,6 +1060,17 @@ static int handle_status(const struct bt_mesh_model *mod, struct bt_mesh_msg_ctx
if (phase != BLE_MESH_DFU_PHASE_APPLYING &&
(target->effect == BLE_MESH_DFU_EFFECT_UNPROV ||
phase != BLE_MESH_DFU_PHASE_IDLE)) {
/**
* If user quickly enter the APPLY state from REFRESH,
* protocol may receive the last round of REFRESH info
* packets from the network. Therefore, in order to avoid
* misjudgment, the previous round of data packets are
* ignored here.
*/
if (phase == BLE_MESH_DFU_PHASE_VERIFY_OK) {
BT_DBG("MaybeReceivedOutdatedMsg");
return 0;
}
BT_WARN("Target 0x%04x in phase %u after apply",
target->blob.addr, phase);
target_failed(cli, target, BLE_MESH_DFU_ERR_WRONG_PHASE);