source: ntrip/trunk/BNC/src/test_serial.cpp@ 9854

Last change on this file since 9854 was 9854, checked in by stuerze, 19 months ago

minor changes

File size: 345 bytes
Line 
1
2#include <unistd.h>
3#include <stdio.h>
4#include <stdlib.h>
5
6int main(int argc, char* argv[]) {
7
8 FILE* fp = fopen("/dev/ttyS0", "r");
9
10 if (!fp) {
11 printf("Cannot open file.\n");
12 exit(9);
13 }
14
15 char msg[100];
16
17 while (true) {
18 int nb = fread(msg, sizeof(msg), 1, fp);
19 printf("read %d\n", nb);
20 sleep(1);
21 }
22
23 return 0;
24}
Note: See TracBrowser for help on using the repository browser.