Category: serial-port

SerialPort + CF 2.0 prevent losing data

Can anyone tell my why the code below would be missing or dropping data. I have been googling all night but can’t find any pointers. the serial port is using the following settings; 38400,n,8,1 xon/xoff flow control. ReceivedBytesThreshold = 1. isReceiving and stockReceived are both members of the form private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) […]

How do I read only available data off a windows COM port?

I have a file handle to a serial (COM) port. I need to read whatever data is available immediately and not wait for additional data to be sent. How can I determine how much data is available? I can call SetCommMask(myHandle, EV_RXCHAR) and then wait for an event to tell me that some data is […]