Skip to content

Commit

Permalink
[nrf fromlist] Bluetooth: Mesh: FU Server should not update internal …
Browse files Browse the repository at this point in the history
…state on error

According to conditions in the DFU spec section 6.1.3.7 (Sending a
Firmware Update Status message) and in 'Idempotency' part of section
6.1.3.4 (Receiving a Firmware Update Start message), the FU Server
should not update internal state when 'Wrong Phase' error condition
is triggered.

Upstream PR: zephyrproject-rtos/zephyr#64258
Signed-off-by: Omkar Kulkarni <[email protected]>
(cherry picked from commit b4eef4da68a5c1f4b02c4d10ee0340375f775a14)
  • Loading branch information
omkar3141 authored and cvinayak committed Oct 23, 2023
1 parent 32a51d9 commit 7ac4181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/mesh/dfu_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ static int handle_start(struct bt_mesh_model *mod, struct bt_mesh_msg_ctx *ctx,
status = BT_MESH_DFU_ERR_WRONG_PHASE;
} else {
status = BT_MESH_DFU_SUCCESS;
srv->update.ttl = ttl;
srv->blob.state.xfer.id = blob_id;
}

srv->update.ttl = ttl;
srv->blob.state.xfer.id = blob_id;
LOG_WRN("Busy. Phase: %u", srv->update.phase);
goto rsp;
}
Expand Down

0 comments on commit 7ac4181

Please sign in to comment.