Index: /trunk/BNC/test_serial.cpp
===================================================================
--- /trunk/BNC/test_serial.cpp	(revision 1608)
+++ /trunk/BNC/test_serial.cpp	(revision 1608)
@@ -0,0 +1,25 @@
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char* argv[]) {
+
+  FILE* fp = fopen("/dev/ttyS0", "w");
+
+  if (!fp) {
+    printf("Cannot open file.\n");
+    exit(1);
+  }
+
+  const char* msg = "message\n";
+
+  while (true) {
+    int nb = fprintf(fp, msg, sizeof(msg));
+    fflush(fp);
+    printf("written %d\n", nb);
+    sleep(1);
+  }
+
+  return 0;
+}
