I\'m writing a Windows Service for communication with a Serial Mag-stripe reader and a relay board (access control system).
I run into problems where the code stops
I think I have come to the conclusion that HyperTerminal does not play well. I've run the following test:
Start my service in "console mode", it starts switching the device on/off (i can tell by it's LED).
Start HyperTerminal and connect to the port. The device stays on (HyperTerminal raises DTR) My service writes to the event log, that it cannot open the port
Stop HyperTerminal, I verify it is properly closed using task manager
The device stays off (HyperTerminal has lowered DTR), my app keeps on writing to the event log, saying it cannot open the port.
I start a third application (the one I need to coexist with), and tell it to connect to the port. I does so. No errors here.
I stop the above mentioned application.
VOILA, my service kicks in again, the port opens successfully, and the LED goes ON/OFF.