source: ntrip/trunk/BNC/test_serial.cpp@ 1608

Last change on this file since 1608 was 1608, checked in by mervart, 15 years ago

* empty log message *

File size: 379 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", "w");
9
10 if (!fp) {
11 printf("Cannot open file.\n");
12 exit(1);
13 }
14
15 const char* msg = "message\n";
16
17 while (true) {
18 int nb = fprintf(fp, msg, sizeof(msg));
19 fflush(fp);
20 printf("written %d\n", nb);
21 sleep(1);
22 }
23
24 return 0;
25}
Note: See TracBrowser for help on using the repository browser.