Can send WTP images now and handle erros.

FossilOrigin-Name: 2b5d9206c2287a0e22f48c6c4f12407ebc07b1b2b03f38be46a1c47d92127950
This commit is contained in:
7u83@mail.ru
2015-03-17 00:10:08 +00:00
parent 17bb8697eb
commit 982fcf93a2
17 changed files with 233 additions and 128 deletions

View File

@ -38,8 +38,10 @@
* Send an image file to an AP
*
*/
void cw_send_image_file(struct conn *conn, const char *filename)
void cw_send_image_file(struct conn *conn, FILE *infile)
{
/*
FILE *infile;
infile = fopen(filename, "rb");
if (!infile) {
@ -49,10 +51,12 @@ void cw_send_image_file(struct conn *conn, const char *filename)
cw_log(LOG_INFO, "Sending image file %s to %s", filename, sock_addr2str(&conn->addr));
*/
struct cwrmsg *cwrmsg;
uint8_t buffer[1024]; /* buffer MUST be 1024 */
struct image_data data;
struct cwimage_data data;
memset(&data,0,sizeof(struct cwimage_data));
data.data = buffer;
@ -87,5 +91,4 @@ void cw_send_image_file(struct conn *conn, const char *filename)
} while (!feof(infile));
fclose(infile);
}