Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

How to detect bluetooth connectoin exist or not?

Thread view: 
bokiteam@ms21.hinet.net - 13 Apr 2005 11:28 GMT
Hi All,
      we can initial/close a Bluetooth connection, if user pause my
program to do other work and then back to my program, how can I detect
the bluetooth connection exist or not?

Should I add check routine in run()?

Best regards,
Boki.
Christian - 14 Apr 2005 12:33 GMT
Hi!

> Hi All,
>        we can initial/close a Bluetooth connection, if user pause my
> program to do other work and then back to my program, how can I detect
> the bluetooth connection exist or not?

Well, how does one usually solve the lost connection problem? *g*
If you connect to a server and then you don't send data for an extended
period of time, the server will kick you.
Usually one should have a timer mechanism that continuosly sends packets
from the sender to show the counterpart that you are still there. This
doesn't have to be done every 10ms, once every 5 min or so should be
enough, provided you don't move your bluetooth stuff too much in and out
of the reception area.

> Should I add check routine in run()?

Either that or you have a separate thread the accesses the then
shared(!) file pointer, sends a short ping and sleeps for 5min.
Closing and opening connections for every send would be another option,
but it depends among other things on what characteristics your traffic has.

HTH
Chris
Boki - 15 Apr 2005 10:19 GMT
Hi, I think this is very practical method :)

Thanks a lot!

Best regards,
Boki.

"Christian" <sichstre@netscape.net>
???????:3c79oqF6l8votU1@news.dfncis.de...

> Hi!
>
[quoted text clipped - 22 lines]
> HTH
> Chris
bokiteam@ms21.hinet.net - 21 Apr 2005 14:50 GMT
Hi,
  If I want to disconnect it...  how can I do ?

Thank you very mcuh!

Best regards,
Boki.

> Hi!
>
[quoted text clipped - 21 lines]
> HTH
> Chris
boki - 22 Apr 2005 21:13 GMT
1. If Sony Ericsson devices, try to hang up it.
2. Tell your Bluetooth firmware.

Best regards,
Boki.

> Hi,
>    If I want to disconnect it...  how can I do ?
[quoted text clipped - 37 lines]
> > HTH
> > Chris
bokiteam@ms21.hinet.net - 24 Apr 2005 17:07 GMT
    public boolean processEvents(InputStream is, OutputStream os) {
        try {

            int bytesToRead = is.available();
...
}

Throws:
   IOException - if an I/O error occurs.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.