RS232 Comms with WideTrack
-
Dear Sirs, I must receive serial bytes in a MFC proyect using a WideTrack buffer (as Greenleaf Comms lib calls it); with every byte I must receive its error status (parity error, frame error) so that I can discard it. The proyect is a propietary protocols monitor in a noisy environment (radio comunications). I've tried to use alternative techniques as to use the error message that comes every time an erroneous byte arrives, but the problem is I'm unable to identificate which one in the waiting queue is the bad one. Can you help me? T.I.A.
-
Dear Sirs, I must receive serial bytes in a MFC proyect using a WideTrack buffer (as Greenleaf Comms lib calls it); with every byte I must receive its error status (parity error, frame error) so that I can discard it. The proyect is a propietary protocols monitor in a noisy environment (radio comunications). I've tried to use alternative techniques as to use the error message that comes every time an erroneous byte arrives, but the problem is I'm unable to identificate which one in the waiting queue is the bad one. Can you help me? T.I.A.
Haven't checked this, but maybe you can set the size of input buffer to 1 (with
SetupComm
) to make it easier to sync bytes received and error messages. Also, the UART has an internal buffer of its own (see Control Panel->System->your COM port->Properties->Configuration->Advanced) that you might want to set down to the minimum. Tell us back if something along this line works. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Haven't checked this, but maybe you can set the size of input buffer to 1 (with
SetupComm
) to make it easier to sync bytes received and error messages. Also, the UART has an internal buffer of its own (see Control Panel->System->your COM port->Properties->Configuration->Advanced) that you might want to set down to the minimum. Tell us back if something along this line works. Joaquín M López Muñoz Telefónica, Investigación y DesarrolloNot sure if I understand the original question exactly or not, but etting the UART to the minimum might be a problem if he can't service the comm before the next character comes in - with Windows this is probably a fairly likely thing and the reason there is a buffer there - it will just be overwritten. You can probably get away with it if the speeds are low - but it seems like you are asking for compatibility problems (i.e. it fails a lot with Winmodems or Cable Modems) if you do this. Can you read the bytes into an intermediate buffer, throw your error if and when you need to, and only pass clean (that pass your test) bytes on to the application? --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)