Advantech RSB-4210 Evaluation Kit User Manual Page 75

  • Download
  • Add to my manuals
  • Print
  • Page
    / 104
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 74
67 RSB-4210 User Manual
Chapter 3 Software Functionality
return(retval);
}
int trun, rrun;
int fd;
int size = 10000;
unsigned int tcount, rcount;
FILE *furead;
void *Uartsend(void * threadParameter)
{
int *tx;
double speed;
double time;
tcount = 0;
tx = malloc(size);
memset(tx, 0x0f, size);
while(trun) {
sleep(1);
tx[0] = 0x55;
time = get_time();
write(fd, tx, size);
time = get_time() - time;
speed = size * 8 / (time/1000000);
tcount += size;
printf("sent %d bytes with speed %fbps\n", size,
speed);
}
free(tx);
return 0;
}
void *Uartread(void * threadParameter)
{
char *rx;
int iores, iocount;
rcount = 0;
while(rrun) {
iocount = 0;
iores = ioctl(fd, FIONREAD, &iocount);
if(!iocount)
continue;
rx = malloc(iocount);
Page view 74
1 2 ... 70 71 72 73 74 75 76 77 78 79 80 ... 103 104

Comments to this Manuals

No comments