Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to detect bluetooth connectoin exist or not?
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.


Report this thread to moderator Post Follow-up to this message
Old Post
bokiteam@ms21.hinet.net
04-13-05 01:57 PM


Re: How to detect bluetooth connectoin exist or not?
bokiteam@ms21.hinet.net wrote:

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


Report this thread to moderator Post Follow-up to this message
Old Post
Christian
04-14-05 08:59 PM


Re: How to detect bluetooth connectoin exist or not?
Hi, I think this is very practical method :)

Thanks a lot!

Best regards,
Boki.


"Christian" <sichstre@netscape.net>
???????:3c79oqF6l8votU1@news.dfncis.de...
> bokiteam@ms21.hinet.net wrote:
>
> Hi!
>
> 
>
> 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.
>
> 
>
> 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
>



Report this thread to moderator Post Follow-up to this message
Old Post
Boki
04-15-05 01:58 PM


Re: How to detect bluetooth connectoin exist or not?
Hi,
If I want to disconnect it...  how can I do ?

Thank you very mcuh!

Best regards,
Boki.

Christian wrote:
> bokiteam@ms21.hinet.net wrote:
>
> Hi!
>
> 
my 
detect 
>
> 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.
>
> 
>
> 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


Report this thread to moderator Post Follow-up to this message
Old Post
bokiteam@ms21.hinet.net
04-21-05 09:00 PM


Re: How to detect bluetooth connectoin exist or not?
1. If Sony Ericsson devices, try to hang up it.
2. Tell your bluetooth firmware.

Best regards,
Boki.


bokiteam@ms21.hinet.net wrote in message news:<1114091411.638749.300390@f14g2000cwb.googleg
roups.com>...
> Hi,
>    If I want to disconnect it...  how can I do ?
>
> Thank you very mcuh!
>
> Best regards,
> Boki.
>
> Christian wrote: 
> my 
> detect 
> extended 
> packets 
> This 
> out 
> option, 
> traffic has. 

Report this thread to moderator Post Follow-up to this message
Old Post
boki
04-23-05 01:58 AM


Re: How to detect bluetooth connectoin exist or not?
public boolean processEvents(InputStream is, OutputStream os) {
try {

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


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


Report this thread to moderator Post Follow-up to this message
Old Post
bokiteam@ms21.hinet.net
04-24-05 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:07 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.