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.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
This commit is contained in:
Omkar Kulkarni 2023-10-23 14:07:48 +02:00 committed by Carles Cufí
commit 3de98643ed

View file

@ -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;
}