serial port, paired device... lazarus / 35-Windows CE ---------------------------------------------------------------------- mmikac · 2010-05-14 18:39 I have to manage detection when serial (print) device is off (automtic power down for example). However, when I define permanent paired connection between IPAQ and this device, neither I get any exception when trying to write to temporaray unavailable device, neither anything else.. (I tried to use 1. try..except on assignfile to com port and rewrite/writeln, 2. ioresult with $i-/$i+ directives, 3. fileexists() ...) ---------------------------------------------------------------------- felipemdc · 2010-05-20 15:55 Maybe you could show some code to make more clear what you are doing. ---------------------------------------------------------------------- Lazlover · 2010-05-20 16:26 RTS/CTS is the "standard way" to detect if device is ready to accept input. If you use only tx & rx-lines without any HW-handshake there is "no way" to detect before you send anything.. Then the "only" option is ask the device if it's alive.. eg. like sending command AT to a modem, you get back OK.. Then you know. Edit: Ahh.. I see now, you want to detect if the local device is still there, not if the extrernal device is alive.. Sorry.. ---------------------------------------------------------------------- mas steindorff · 2010-05-20 19:50 I found a (good) unit already writen for the serial port called Synapse writen by Lukas Gebauer Found at URL: http://www.ararat.cz/synapse It uses the Windows registry to determine which ports are active in Windows under the /HARDWARE\DEVICEMAP\SERIALCOMM' key in the "HKEY_LOCAL_MACHINE" root. For Linux the funtion just returns the result of '/dev/ttyS0,/dev/ttyS1,/dev/ttyS2,/dev/ttyS3' The Windows device drivers will update the registry anytime they detect new hardware like a USB serial device. There is another key somewhere in the registry that list all of the ports that have ever been connected not that it's not what you're looking for