1 // Test program for serial communication. Visual C / MFC Version
2 // Bela Torok / bela.torok@kssg.ch, March 2001
4 #include <afxwin.h> // Defines the entry point for the console application.
11 int main(int argc, char* argv[])
16 hComPort = SerialInit("com1", 1200, 8, 1, 'N', 'N', 5000, 5000, 2, 128);
19 printf("\n\nError initializing %s!\n", "com1");
23 // write string to RS232
24 SerialPuts(&hComPort, "\nInitialize\n");
27 // read string from RS232
28 printf("\nString received: %s\n", SerialGets(buf, sizeof (buf) - 1, hComPort));
30 CloseHandle(hComPort);