Skip to content

Commit 1465f44

Browse files
committed
Fixing isDone() calculation
1 parent fb08ebf commit 1465f44

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

MeshBase.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ bool MeshBase::Message::IsDone() const
124124
Serial.print(" split_part=");
125125
Serial.print(header.split_part);
126126
Serial.print(" blocks_recieved=");
127-
Serial.println(blocks_recieved);
128-
if (!header.split_more && blocks_recieved >= header.split_part)
127+
Serial.print(blocks_recieved);
128+
if (!header.split_more && blocks_recieved > header.split_part)
129+
{
130+
Serial.println(" - True **");
129131
return true;
130-
Serial.println(" R IsDone() : False");
132+
}
133+
Serial.println(" - False");
131134
return false;
132135
}
133136

@@ -149,7 +152,6 @@ void MeshBase::HandlePacket(const byte* data, uint8_t len)
149152
}
150153
s->AddPart(payload, payload_length, header->split_part, header->split_more);
151154
if (s->IsDone()) {
152-
Serial.println(" R IsDone() : true!!");
153155
switch(header->type) {
154156
case type_peer_discovery:
155157
HandlePeerDiscovery(&(s->header), s->data, s->data_used);

0 commit comments

Comments
 (0)