Add OTA handling for BWM ESP commands

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
Niel Nielsen authored and GitHub committed 2026-09-03 08:57:12 +02:00
1 parent efed954b25
commit 229e89ef50
1 file changed
+19
+19
View File
@@ -3866,6 +3866,25 @@ static void PacketReceived(PacketCommandNG *packet) {
break;
}
#ifdef WITH_BWM_STATUS
case CMD_PM5_BWM_ESP_OTA: {
uint8_t action = packet->data.asBytes[0];
int ret;
switch (action) {
case BWM_OTA_ACTION_BEGIN:
ret = bwm_esp_ota_begin(*(uint32_t *)(packet->data.asBytes + 1));
break;
case BWM_OTA_ACTION_WRITE:
ret = bwm_esp_ota_write(packet->data.asBytes + 1, packet->length - 1);
break;
case BWM_OTA_ACTION_END:
ret = bwm_esp_ota_end();
break;
default:
ret = PM3_EINVARG;
}
reply_ng(CMD_PM5_BWM_ESP_OTA, ret, NULL, 0);
break;
}
case CMD_PM5_BWM_SET_VCHG: {
// Set the AW32001E charge-voltage target (REG04 VBAT_REG).
// Payload: optional uint16 mV (LE); absent -> default.