X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Fexamples%2Fserialcomm%2Fwindows%2Ftest_serialcomm.cpp;fp=device%2Fexamples%2Fserialcomm%2Fwindows%2Ftest_serialcomm.cpp;h=32f409ba830b9a37f3462a5549c42984b470b6e0;hb=bdefcbe8acf9791856b28f2bef02e7eb4c40aecf;hp=fd0fc95395ca032be434612746209efc8d30ec0e;hpb=8109c4f48a6f4c6e796d42129f53f2b6fc3e26e8;p=fw%2Fsdcc diff --git a/device/examples/serialcomm/windows/test_serialcomm.cpp b/device/examples/serialcomm/windows/test_serialcomm.cpp index fd0fc953..32f409ba 100755 --- a/device/examples/serialcomm/windows/test_serialcomm.cpp +++ b/device/examples/serialcomm/windows/test_serialcomm.cpp @@ -10,12 +10,10 @@ int main(int argc, char* argv[]) { - HANDLE hComPort; + char buf[128]; - int ComPortNumber = 1; - - hComPort = SerialInit("com1", 1200); // 1200 Baud + hComPort = SerialInit("com1", 1200, 8, 1, 'N', 'N', 5000, 5000, 2, 128); if( hComPort == 0) { printf("\n\nError initializing %s!\n", "com1"); @@ -27,7 +25,7 @@ int main(int argc, char* argv[]) // sleep(5000); // read string from RS232 - printf("\nString received: %s\n", SerialGets(&hComPort)); + printf("\nString received: %s\n", SerialGets(buf, sizeof (buf) - 1, hComPort)); CloseHandle(hComPort);