summaryrefslogtreecommitdiff
path: root/RS-232/demo_tx.c
diff options
context:
space:
mode:
authorHaoran S. Diao <0@hairydiode.xyz>2019-04-13 17:54:16 -0400
committerHaoran S. Diao <0@hairydiode.xyz>2019-04-13 17:54:16 -0400
commit18a0c695a74081bf73c44921c7af43acf5933885 (patch)
tree111456f766874d72e56c72974cd70257df18a53e /RS-232/demo_tx.c
parentf14a8e9006a84c44a65163f301efaa8a000bfa06 (diff)
removed redundant rs232 files
Diffstat (limited to 'RS-232/demo_tx.c')
-rw-r--r--RS-232/demo_tx.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/RS-232/demo_tx.c b/RS-232/demo_tx.c
deleted file mode 100644
index bd43fb4..0000000
--- a/RS-232/demo_tx.c
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/**************************************************
-
-file: demo_tx.c
-purpose: simple demo that transmits characters to
-the serial port and print them on the screen,
-exit the program by pressing Ctrl-C
-
-compile with the command: gcc demo_tx.c rs232.c -Wall -Wextra -o2 -o test_tx
-
-**************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifdef _WIN32
-#include <Windows.h>
-#else
-#include <unistd.h>
-#endif
-
-#include "rs232.h"
-
-
-
-int main()
-{
- int i=0,
- cport_nr=0, /* /dev/ttyS0 (COM1 on windows) */
- bdrate=9600; /* 9600 baud */
-
- char mode[]={'8','N','1',0},
- str[2][512];
-
-
- strcpy(str[0], "The quick brown fox jumped over the lazy grey dog.\n");
-
- strcpy(str[1], "Happy serial programming!\n");
-
- if(RS232_OpenComport(cport_nr, bdrate, mode))
- {
- printf("Can not open comport\n");
-
- return(0);
- }
-
- while(1)
- {
- RS232_cputs(cport_nr, str[i]);
-
- printf("sent: %s\n", str[i]);
-
-#ifdef _WIN32
- Sleep(1000);
-#else
- usleep(1000000); /* sleep for 1 Second */
-#endif
-
- i++;
-
- i %= 2;
- }
-
- return(0);
-}
-