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

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

minor changes

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