I have developed a GUI based application in C# for communicating with a 16 bit littleendian microcontroller device .the device has a serial port interface.
1.my appplication opens a COM port on which the device is connected with proper settings for the device.
2.It writes a command to the port.
3.datareceived event of the serial port reads the data in to a byte array.
3.i have closed the serialport using close() method
The problem that i m facing is,
1.Immediately after opening the port (before giving any request to the device)i am getting the data on serialport)this data is the data that i was receiving in the previous run of the application.
2For any command i am writing to the serial port (to make changes to the reply)There is a delay before getting the modified reply .During this delay i am receiving the old data(without modifications)
3.After switching off the device i am receiving the data for sometime
Is this is because of the uncleared buffer?
I have tried with Basestream.flus h() before writing a command to the port.
1.my appplication opens a COM port on which the device is connected with proper settings for the device.
2.It writes a command to the port.
3.datareceived event of the serial port reads the data in to a byte array.
3.i have closed the serialport using close() method
The problem that i m facing is,
1.Immediately after opening the port (before giving any request to the device)i am getting the data on serialport)this data is the data that i was receiving in the previous run of the application.
2For any command i am writing to the serial port (to make changes to the reply)There is a delay before getting the modified reply .During this delay i am receiving the old data(without modifications)
3.After switching off the device i am receiving the data for sometime
Is this is because of the uncleared buffer?
I have tried with Basestream.flus h() before writing a command to the port.
Comment