Skip to content

Commit 7ac4181

Browse files
omkar3141cvinayak
authored andcommitted
[nrf fromlist] Bluetooth: Mesh: FU Server should not update internal 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)
1 parent 32a51d9 commit 7ac4181

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/mesh/dfu_srv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ static int handle_start(struct bt_mesh_model *mod, struct bt_mesh_msg_ctx *ctx,
302302
status = BT_MESH_DFU_ERR_WRONG_PHASE;
303303
} else {
304304
status = BT_MESH_DFU_SUCCESS;
305+
srv->update.ttl = ttl;
306+
srv->blob.state.xfer.id = blob_id;
305307
}
306308

307-
srv->update.ttl = ttl;
308-
srv->blob.state.xfer.id = blob_id;
309309
LOG_WRN("Busy. Phase: %u", srv->update.phase);
310310
goto rsp;
311311
}

0 commit comments

Comments
 (0)