Hi:
If I use COM1(hCom1) write data and COM2(hCom2) to receive data, so:
Code:
#define input_Buffer 2 //for hCom2 input buffer
//#define output_Buffer 10
char valRead[20]={0};
SetupComm(hCom2, input_Buffer, output_Buffer)
/* hCom2 only can have only 2 bytes receved at time, right??*/
/*assume that there are 100 bytes already in hCom1 and I use one cable to connect COM1 and COM2 with each other*/
/*now I start reading from COM2*/
ReadFile(hCom2, &valRead, 10, &dwRead, NULL);
the problem now is:
I think there must be only 2 bytes in buffer valRead cause the maximum input buffer in hCom2 is 2 bytes only. But always there are 10 bytes in valRead, Why??? and it still is not working with
dcb.ByteSize= 2;
.
Thanks for help.