Clear input buffer

Last post 11-01-2007 8:56 by Anonymous. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 11-01-2007 8:56

    Clear input buffer

    Ok so I'll explain what I'm doing first...

    I am using a device which has basically two serial ports. I am writing an application which will send a packet of data to the device port A. The device then will send a packet of data over port B. I decode this packet and respond. The device then sends a packet of data over port A. So I'm asking the device something, the device is then essentially asking me over the different port and then I tell it what it wants and it then responds over port A.

    My problem is that the device upon start up will send out a few packets. When I open the port (after the device is done sending data) I see those packets (which by the way are valid packets). It seems when I do port.Close(), it still receives and stores the data. Then if you do a port.Open() the data received event is raised and you can grab the packets (which shouldn't be there). Is there a way to clear the rx buffer before you open the port? Any help would be much appreciated. Thanks
Page 1 of 1 (1 items)