ev3duder  0.3.0
EV3 Downloader/Uploader
send.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <string.h>
3 #include "defs.h"
4 #include "ev3_io.h"
5 
6 int send()
7 {
8  char buffer[1023];
9  buffer[0] = 0;
10  int written;
11  while (fgets(buffer + 1, sizeof buffer - 1, stdin))
12  {
13  size_t len = strlen(buffer+1) + 1;
14  written = ev3_write(handle, (u8*)buffer, len);
15  printf("%d bytes read.\n", written);
16  }
17 
18  return 0;
19 }
20 
EXTERN void * handle
Definition: ev3_io.h:17
int send()
Definition: send.c:6
uint8_t u8
Definition: defs.h:9
EXTERN int(* ev3_write)(void *, const u8 *, size_t)
Definition: ev3_io.h:13