Handle final empty packet

Handle the case where the master sends a final empty packet to indicate
end of transfer
pull/3/head
Hans-Erik Floryd 2014-10-28 16:17:53 +01:00
parent 6fbb2f7dae
commit df1718894a
1 changed files with 6 additions and 0 deletions

View File

@ -493,6 +493,12 @@ void FOE_data ()
DPRINT("FOE_data packet error,packet: %d foeheaader.packet: %d\n",packet,FOEvar.foepacket);
FOE_abort (FOE_ERR_PACKETNO);
}
else if (data_len == 0)
{
DPRINT("FOE_data completed\n");
res = FOE_send_ack ();
FOE_init ();
}
else if (FOEvar.fposition + data_len > FOEvar.fend)
{
DPRINT("FOE_data disk full\n");