If I on purpose send the wrong file size in the start command.
The device sends a NACK as expected, then sends an ACK right after.
The device is updated, even though the file size does not match the size written.
The issue seems to happen in this line:
if (_file_written != _file_size) {
sendCommandAnswer(STOP_OTA, NACK);
}
perhaps you need to add a return:
if (_file_written != _file_size) {
sendCommandAnswer(STOP_OTA, NACK);
return;
}
If I on purpose send the wrong file size in the start command.
The device sends a NACK as expected, then sends an ACK right after.
The device is updated, even though the file size does not match the size written.
The issue seems to happen in this line:
perhaps you need to add a return: