Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions tinyTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,23 @@ bool TinyTransferUpdateParser::processByte(uint8_t byte){

//If checksum of header matches header checksum in the array
if(redo_checksum == inputPacket.headerChecksum){
//Empty packet - still valid
if (inputPacket.payloadSize == 0) {
// Empty packet - still valid
if (inputPacket.payloadSize == 0 && inputPacket.logSize == 0) {
init();
return true;
}

//Transition to payload parsing
state = TINY_TRANSFER_PARSER_PAYLOAD;
position = 0;
else if (inputPacket.payloadSize == 0 && inputPacket.logSize > 0) {
state = TINY_TRANSFER_PARSER_LOG;
position = 0;

}
else {
// Transition to payload parsing
state = TINY_TRANSFER_PARSER_PAYLOAD;
position = 0;
}

}

//invalid checksum, start over again
Expand Down