how I can detect if the device is connected?
AFAICT, there's no way but I'd like to be wrong. In a protocol I had to implement, there were two messages designed to detect this, the typical ping and pong. On startup, a ping was sent and the program assumed there was no connection if no pong was received. Both peers did the same. So, in any case, the second machine that went online caused the connection to be active.
| [reply] |
In a serial protocol the presence of an external device can pe indicated by asserting DSR. FreeBSD, for example, will block on open if DSR is not asserted and clocal is set. Without more infomation ( system, driver, sample code ) it would difficult to provide anything specific to your application.
bitman writes:
"If so, can I get an example?"
Show me yours and I'll show you mine.
s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s
|-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,,
$|=1,select$,,$,,$,,1e-1;print;redo}
| [reply] [d/l] |