Reading data from Serial Port.
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I am drawing a newbie blank here. Can someone show me how to read 20 bytes from the serial port using this code: BOOL CSerialPort::ReadByte(BYTE &resp) { BYTE rx; resp=0; DWORD dwBytesTransferred=0; if (ReadFile (hComm, &rx, 1, &dwBytesTransferred, 0)) { if (dwBytesTransferred == 1) { resp=rx; return true; } } return false; } Thanks
-
I am drawing a newbie blank here. Can someone show me how to read 20 bytes from the serial port using this code: BOOL CSerialPort::ReadByte(BYTE &resp) { BYTE rx; resp=0; DWORD dwBytesTransferred=0; if (ReadFile (hComm, &rx, 1, &dwBytesTransferred, 0)) { if (dwBytesTransferred == 1) { resp=rx; return true; } } return false; } Thanks