add counting total size of received file
parent
036fb47dc3
commit
7e380b671c
|
@ -78,6 +78,7 @@ int FOE_fopen (char *name, uint8_t num_chars, uint32_t pass, uint8_t op)
|
|||
{
|
||||
foe_file = &foe_files[i];
|
||||
foe_file->address_offset = 0;
|
||||
foe_file->total_size = 0;
|
||||
switch (op)
|
||||
{
|
||||
case FOE_OP_RRQ:
|
||||
|
@ -157,6 +158,8 @@ uint16_t FOE_fwrite (uint8_t *data, uint16_t length)
|
|||
ncopied++;
|
||||
}
|
||||
|
||||
foe_file->total_size += ncopied;
|
||||
|
||||
DPRINT("FOE_fwrite END with : %d\n",ncopied);
|
||||
return ncopied;
|
||||
}
|
||||
|
|
|
@ -27,9 +27,11 @@ struct foe_writefile_cfg
|
|||
uint32_t dest_start_address;
|
||||
/** Current address during write of file */
|
||||
uint32_t address_offset;
|
||||
/* FoE password */
|
||||
/** Calculated size of file received */
|
||||
uint32_t total_size;
|
||||
/** FoE password */
|
||||
uint32_t filepass;
|
||||
/* Pointer to application foe write function */
|
||||
/** Pointer to application foe write function */
|
||||
uint32_t (*write_function) (foe_writefile_cfg_t * self, uint8_t * data);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue