Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

Using SdpoSerial, how to clear buffers?

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have started to code using the SdpoSerial component and now I am in need of a way to clear the receive and transmit buffers.

I have not found any useful method in the TSdpoSerial object but it exposes the underlying SynSer component so by testing this I found two candidates:
var

  FComm: TSdpoSerial;

begin
...
FComm.SynSer.Flush
FComm.SynSer.Purge

What does these methods do? Are they useful to get rid of stuff in the comm buffers when starting over with the communication protocol?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 16 lines
I have started to code using the SdpoSerial component and now I am in need of a way to clear the receive and transmit buffers. I have not found any useful method in the TSdpoSerial object but it exposes the underlying SynSer component so by testing this I found two candidates: var FComm: TSdpoSerial; begin ... FComm.SynSer.Flush FComm.SynSer.Purge What does these methods do? Are they useful to get rid of stuff in the comm buffers when starting over with the communication protocol?

Never mind,
I found the answer in the synaser sourcefile:
Purge will clear the buffers, Flush will not.

Bo Berglund Developer in Sweden

Reply by email