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

Last change on this file since 9955 was 9955, checked in by stuerze, 15 months ago

minor changes

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