* [Bluez-devel] What happens with bluetooth when connection is interrupted
@ 2008-09-18 9:42 Reto Bachmann
2008-09-18 12:08 ` rakesh agarwal
2008-09-18 17:11 ` Marcel Holtmann
0 siblings, 2 replies; 6+ messages in thread
From: Reto Bachmann @ 2008-09-18 9:42 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1.1: Type: text/plain, Size: 452 bytes --]
Hi to all,
I have a little question. I have to develop an Application where it can
happen that the connection interrupts. I poll the adapter every second to
see if I am still connected to the specific device. Now I have to know if
there is a possibility that the bluez-function "isConnected(string address)"
(D-Bus-Function) returns false but the connection itself is recovered by the
BT-Stack so the connection would still exist.
Kind regards,
Reto
[-- Attachment #1.2: Type: text/html, Size: 503 bytes --]
[-- Attachment #2: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] What happens with bluetooth when connection is interrupted
2008-09-18 9:42 [Bluez-devel] What happens with bluetooth when connection is interrupted Reto Bachmann
@ 2008-09-18 12:08 ` rakesh agarwal
2008-09-18 17:11 ` Marcel Holtmann
1 sibling, 0 replies; 6+ messages in thread
From: rakesh agarwal @ 2008-09-18 12:08 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 1221 bytes --]
Hi to all,
Can anyone post a sample program for bonding with bluetooth device in C
language.
Regards,
Rakesh
On Thu, Sep 18, 2008 at 3:12 PM, Reto Bachmann <reto.bachmann@gmail.com>wrote:
> Hi to all,
>
> I have a little question. I have to develop an Application where it can
> happen that the connection interrupts. I poll the adapter every second to
> see if I am still connected to the specific device. Now I have to know if
> there is a possibility that the bluez-function "isConnected(string address)"
> (D-Bus-Function) returns false but the connection itself is recovered by the
> BT-Stack so the connection would still exist.
>
> Kind regards,
> Reto
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>
[-- Attachment #1.2: Type: text/html, Size: 1816 bytes --]
[-- Attachment #2: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] What happens with bluetooth when connection is interrupted
2008-09-18 9:42 [Bluez-devel] What happens with bluetooth when connection is interrupted Reto Bachmann
2008-09-18 12:08 ` rakesh agarwal
@ 2008-09-18 17:11 ` Marcel Holtmann
2008-09-19 6:56 ` Reto Bachmann
1 sibling, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2008-09-18 17:11 UTC (permalink / raw)
To: BlueZ development
Hi Reto,
> I have a little question. I have to develop an Application where it
> can happen that the connection interrupts. I poll the adapter every
> second to see if I am still connected to the specific device. Now I
> have to know if there is a possibility that the bluez-function
> "isConnected(string address)" (D-Bus-Function) returns false but the
> connection itself is recovered by the BT-Stack so the connection would
> still exist.
whatever you do don't poll for a status. You will get a D-Bus signal if
you are connected or paired etc. Check how bluez-gnome is doing it.
Regards
Marcel
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] What happens with bluetooth when connection is interrupted
2008-09-18 17:11 ` Marcel Holtmann
@ 2008-09-19 6:56 ` Reto Bachmann
2008-09-19 8:18 ` Patryk Zawadzki
0 siblings, 1 reply; 6+ messages in thread
From: Reto Bachmann @ 2008-09-19 6:56 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 997 bytes --]
Hi Marcel,
whatever you do don't poll for a status. You will get a D-Bus signal if
> you are connected or paired etc. Check how bluez-gnome is doing it.
So I need to connect the D-Bus signal RemoteDeviceDisconnected to find out
that I am not connected anymore?
Why shouldn't I poll for a status? Is it just because a signal is sent
either way or is the status i ask for not the true status?
Regards,
Reto
>
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
[-- Attachment #1.2: Type: text/html, Size: 1782 bytes --]
[-- Attachment #2: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] What happens with bluetooth when connection is interrupted
2008-09-19 6:56 ` Reto Bachmann
@ 2008-09-19 8:18 ` Patryk Zawadzki
2008-09-22 6:08 ` Reto Bachmann
0 siblings, 1 reply; 6+ messages in thread
From: Patryk Zawadzki @ 2008-09-19 8:18 UTC (permalink / raw)
To: BlueZ development
On Fri, Sep 19, 2008 at 8:56 AM, Reto Bachmann <reto.bachmann@gmail.com> wrote:
> So I need to connect the D-Bus signal RemoteDeviceDisconnected to find out
> that I am not connected anymore?
>
> Why shouldn't I poll for a status? Is it just because a signal is sent
> either way or is the status i ask for not the true status?
Because polling is the worst strategy both CPU- and power-wise. It
causes frequent wakeups that waste power and prevent CPUs from
entering a deep idle state. They also generate unnecessary traffic for
the IPC mechanism so if every program decided to poll for something
once a second, services like DBus would likely get hosed.
--
Patryk Zawadzki
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] What happens with bluetooth when connection is interrupted
2008-09-19 8:18 ` Patryk Zawadzki
@ 2008-09-22 6:08 ` Reto Bachmann
0 siblings, 0 replies; 6+ messages in thread
From: Reto Bachmann @ 2008-09-22 6:08 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 1629 bytes --]
Hi Patryk,
i see the problems and I will change it. I now made some tests and i found
out that the library waits for a specific time until it sends the signal. I
suppose that in this time it tries to repair the connection.
Is it possible to manage this time period with compiling flags or something?
Thanks,
Reto
2008/9/19 Patryk Zawadzki <patrys@pld-linux.org>
> On Fri, Sep 19, 2008 at 8:56 AM, Reto Bachmann <reto.bachmann@gmail.com>
> wrote:
> > So I need to connect the D-Bus signal RemoteDeviceDisconnected to find
> out
> > that I am not connected anymore?
> >
> > Why shouldn't I poll for a status? Is it just because a signal is sent
> > either way or is the status i ask for not the true status?
>
> Because polling is the worst strategy both CPU- and power-wise. It
> causes frequent wakeups that waste power and prevent CPUs from
> entering a deep idle state. They also generate unnecessary traffic for
> the IPC mechanism so if every program decided to poll for something
> once a second, services like DBus would likely get hosed.
>
> --
> Patryk Zawadzki
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
[-- Attachment #1.2: Type: text/html, Size: 2414 bytes --]
[-- Attachment #2: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-22 6:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 9:42 [Bluez-devel] What happens with bluetooth when connection is interrupted Reto Bachmann
2008-09-18 12:08 ` rakesh agarwal
2008-09-18 17:11 ` Marcel Holtmann
2008-09-19 6:56 ` Reto Bachmann
2008-09-19 8:18 ` Patryk Zawadzki
2008-09-22 6:08 ` Reto Bachmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox