Public Access
OTA: answer once the announced image size has arrived
The Arduino network client treats a half-closed connection as closed, so the device's reply after the sender's EOF was lost. The header already carries the image size: UpdateParser::complete() lets the device finish and answer while the connection is open. ota_push.py half-closes only if no answer comes within 3 s, for older firmware. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -50,6 +50,8 @@ class UpdateParser {
|
||||
|
||||
void feed(const uint8_t* data, size_t len);
|
||||
bool end(); // no more data: true if the update was installed
|
||||
// The whole image the header announced has arrived (the sender need not close the connection).
|
||||
bool complete() const { return state_ == State::Image && received_ == imageSize_; }
|
||||
|
||||
State state() const { return state_; }
|
||||
const std::string& error() const { return error_; }
|
||||
|
||||
Reference in New Issue
Block a user