Found before sending, baud rate has been changed, as a result, I send the frame data is wrong,
: : SendMessage ((port - & gt; M_pOwner) - & gt; M_hWnd, WM_COMM_TXEMPTY_DETECTED, 0, (LPARAM) port - & gt; M_nPortNr);
I call the above news, found or not, for instance to send 1024 bytes, it is not in accordance with the last few bytes before the baud rate to but according to the changed baud rate, that didn't change the baud rate, at the completion of a send
Question: how to judge the data has been sent finished? , genuflect is begged for help to solve the problem!
CodePudding user response:
SetCommMask WaitCommEvent waiting EV_TXEMPTY eventsOr ClearCommError judge COMSTAT parameters cbOutQue==0