Recent

Author Topic: synaser handling timeout ?  (Read 3684 times)

jmg

  • New Member
  • *
  • Posts: 33
synaser handling timeout ?
« on: June 29, 2012, 12:44:12 am »
  I have synaser ticking over nicely, and decided to clean up some exception cases.

  One instance I wanted to cover,  is a connected device (FTDI), where everything works _but_ the remote end does not empty.
 ie a system state with a full buffer on the end of the cable, and some bytes still in the PC queue.

 This will be rare, but more graceful handling would be good.

 I have activated Timeout ok, and hooked into the exception, but when I try to close the port, in TBlockSerial.CloseSocket, it seems to stall on the line : FileClose(integer(FHandle));
 This means I can Step/break fine up to here, but FileClose never returns   -  until I physically unplug the USB cable.
Then it continues...

 I suspect because SOME data has gone, it thinks it is still active, so refuses to close ?

I cannot find any other Close/release paths, but   I found a couple of examples on here, which suggest this should work, but they are not for my exact test case.

 CloseSocket seems to work fine, provided there is no over-run
(ie no bytes still in queue at PC end )

 Has anyone got examples, or comments on handling this case ?
Or anything else I need to do, before Close ?
 ( I see CloseSocket includes a purge call.)
« Last Edit: June 29, 2012, 12:52:44 am by jmg »

pascalbythree

  • Sr. Member
  • ****
  • Posts: 292
Re: synaser handling timeout ?
« Reply #1 on: May 04, 2015, 09:42:37 pm »
1. Does anybody have freepascal/kylix/lazarus source code. To open a socket in the pascal syntax on a RPI?

1. Does anybody have freepascal/kylix/lazarus source code. To open i2c stream in the pascal syntax on a RPI?

Or de GPIO port or the FTDI USB adapter will do.

 

TinyPortal © 2005-2018