renamed capwap directory to cw.
FossilOrigin-Name: 8a43dd9d05a4cb73210243ddd8df2a26f16c7ef2c4d4e36ab446de1f65d88223
This commit is contained in:
25
src/cw/lw_put_image_data.c
Normal file
25
src/cw/lw_put_image_data.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include "lwapp.h"
|
||||
|
||||
int lw_put_image_data(uint8_t *dst,FILE *infile)
|
||||
{
|
||||
if ( feof(infile)){
|
||||
lw_put_byte(dst+0,1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int bytes = fread(dst+3,1,LW_BLOCKSIZE_IMAGE_DATA,infile);
|
||||
|
||||
if ( ferror(infile)) {
|
||||
lw_put_byte(dst+0,5);
|
||||
return 1;
|
||||
}
|
||||
|
||||
lw_put_byte(dst,3);
|
||||
|
||||
uint16_t checksum = lw_checksum(dst+3,bytes);
|
||||
lw_put_word(dst+1,checksum);
|
||||
|
||||
return bytes+3;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user