OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
578 stars 249 forks source link

FoE EOF/file length detection. #35

Closed ghost closed 6 years ago

ghost commented 6 years ago

Finding EOF/length of a binary file during FoE transfer is hard if you can't rule out a single byte to use as foe_cfg.empty_write.

With a length argument you can add up to get the file length and when length < foe_cfg.buffer_size this was the last data packet (FOE_fclose) which can trigger handling of the received file.

nakarlsson commented 6 years ago

Thanks, makes sense and is an improvment