Re: Bluetooth Driver
Chris Rotberg <[email protected]> Sun, 18 May 2008 12:06:37 -0700
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <[email protected]> |
I am using the javax.Bluetooth classes What are the stack events that are thrown, is seems I am having trouble catching the SocketException, it is showing a phone generated disconnect notice that I am trying to catch Thanks _____ From: A mailing list for KVM discussion [mailto:[email protected]] On Behalf Of Roger Sent: Saturday, May 17, 2008 10:22 AM To: [email protected] Subject: Re: Bluetooth Driver Just split up your exception handling (what do you mean by "valid exception"?). Once you catch a SocketException (or similar), you shouldn't have any problems with categorizing the problem. Another tipp: let em ping frequently. Bluetooth connections aren't as stable as usual socket connections for some particular reasons, that are plain to see. So the exception might be thrown before the trouble raises and you even might reconnect in time. I highly appreciate writing a very sophisticated Connection (-Pool) Manager since Bluetooth surprises in several cases. Keep in mind, that there are lots of different BT stacks. E.g. a Widcomm stack works completely different from BlueZ asf.. Best, Roger Chris Rotberg schrieb: I am writing a Bluetooth driver and am trying to implement auto reconnect, I can sucessfully connect and disconnect. I want to have the application auto connect if the connection is dropped. I have listeners that raise events for open streamConn = (StreamConnection)Connector.open("btspp://" + address); but once the connection is open how can I detect if the connection is dropped? I could add a exception handler on read() but there could be a valid exception and I can not assume that an exception is a dropped connection. Is there a way to detect if the StreamConnection is closed? Thanks =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help". -- /************************** * Roger F. Hösl * Engelthaler Str. 5 * 60435 Frankfurt * Fon: (069) 79202638 * Mobil: 0172 1409984 * Fax: (069) 79202978 * Mail: [email protected] **************************/ =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".