From 8a27354d4ba9ee7d3afface22aa1298114130902 Mon Sep 17 00:00:00 2001 From: Niel Nielsen Date: Thu, 3 Sep 2026 09:44:45 +0200 Subject: [PATCH] Refactor OTA response handling for clarity Signed-off-by: Niel Nielsen --- client/src/cmdhw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index 91ca54b49..9f354b62d 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -2356,9 +2356,14 @@ static int CmdBWMUpgrade(const char *Cmd) { memcpy(buf + 1, fw + sent, n); clearCommandBuffer(); SendCommandNG(CMD_PM5_BWM_ESP_OTA, buf, (uint16_t)(n + 1)); - if ((WaitForResponseTimeout(CMD_PM5_BWM_ESP_OTA, &resp, 12000) == false) || (resp.status != PM3_SUCCESS)) { + bool got = WaitForResponseTimeout(CMD_PM5_BWM_ESP_OTA, &resp, 12000); + if (!got || resp.status != PM3_SUCCESS) { PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(FAILED, "OTA write failed at offset %zu", sent); + if (!got) { + PrintAndLogEx(FAILED, "OTA write failed at offset %zu (no response - link/BWM unresponsive)", sent); + } else { + PrintAndLogEx(FAILED, "OTA write failed at offset %zu (status %d)", sent, resp.status); + } free(buf); free(fw); return PM3_EFAILED;