Hi:
If I want the program to know whether it is the end of data in the input buffer in the serial port. So I do:
but it didn't work, even if the string in the input buffer is, for example {'1','2','3','4'},Code:DCB dcb={0}; if(!GetCommState(hCom1, &dcb)) //get default dcb settings printf ("GetCommState is failed\n"); dcb.EofChar = '3'; //want character '3' to indicate the end of //the data in the input buffer if(!SetCommState(hCom1,&dcb)) //re-set the dcb { printf("%d\n",GetLastError()); printf("SetCommState is failed\n"); }
but it still read the whole string, I think character '4' should be read at least. What's going on with this??Thank you.



LinkBack URL
About LinkBacks
Thank you. 



