OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
581 stars 250 forks source link

FoE, add variabled for holding the size of received file #12

Closed nakarlsson closed 6 years ago

nakarlsson commented 8 years ago

Add variable in foe_writefile_cfg to hold the calculated size of the received file. The total size may be used in CRC calculations on completion.

nakarlsson commented 8 years ago

****Suggestion of addition to writefile to integrate file verification

struct foe_writefilecfg { /\ Name of file to receive from master / const char * name; /* Size of file,sizeof data we can recv / uint32_t maxdata; /* Where to store the data initially _/ uint32_t dest_startaddress; /* Current address during write of file _/ uint32_t addressoffset; /* Calutlated size of file received _/ uint32_t totalsize; / FoE password _/ uint32t filepass; / Pointer to application foe write function _/ uint32_t (_write_function) (foe_writefile_cfg_t * self, uint8t * data); /* Pointer to application foe verification function / int32_t (_check_function) (foe_writefile_cfg_t * self); };



nakarlsson commented 6 years ago

Fixed for PR https://github.com/OpenEtherCATsociety/SOES/pull/32 in https://github.com/OpenEtherCATsociety/SOES/pull/32/commits/7e380b671ccb3ac5cedbabcdb74b4a4ecdbc68f3