All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] clearing remote name cache
@ 2007-03-27 10:00 Emanuele Novelli
  2007-03-27 10:32 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Emanuele Novelli @ 2007-03-27 10:00 UTC (permalink / raw)
  To: Bluez-users


[-- Attachment #1.1: Type: text/plain, Size: 1274 bytes --]

Hi using the hints about reading remote names from various threads I got on
this ML time ago I started experiments with D-Bus API for bluez.

I tried to read a remotename in a thread called from another thread who does
inquiry.
Each time he found a bdaddress he ask for a name
(snipped code)

msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0", "
org.bluez.Adapter", "GetRemoteName");
dbus_message_append_args(msg, DBUS_TYPE_STRING,
&bdaddress,DBUS_TYPE_INVALID);
reply = dbus_connection_send_with_reply_and_block(conn, msg, -1, &err);
 if (reply == NULL) {
 printf("Error %s\n",err.message);

  }
 else {
 dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID);
                PBLOG_INFO("%s\n", name);
}

all works well till I change the name of the remote device (a phone). Each
time I run the program I still get the old name, no matter how can try.
Only workaround I got to solve this is to manually invoke hcitool name
<bdaddress> to change the actual name in cache.


P.S.
I'm rather new to dbus, but everywhere I read advices about dont using the
low level api but use an high level bindings (G-lib, Java, python) but most
of examples I found in bluez source codes use low leve apis, so I guess is
correct using that or not ?

[-- Attachment #1.2: Type: text/html, Size: 1518 bytes --]

[-- Attachment #2: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] clearing remote name cache
  2007-03-27 10:00 [Bluez-users] clearing remote name cache Emanuele Novelli
@ 2007-03-27 10:32 ` Marcel Holtmann
  2007-03-27 12:44   ` Emanuele Novelli
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2007-03-27 10:32 UTC (permalink / raw)
  To: BlueZ users

Hi Emanuele,

> Hi using the hints about reading remote names from various threads I
> got on this ML time ago I started experiments with D-Bus API for
> bluez.
> 
> I tried to read a remotename in a thread called from another thread
> who does inquiry. 
> Each time he found a bdaddress he ask for a name
> (snipped code)
> 
> msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0",
> "org.bluez.Adapter", "GetRemoteName"); 
> dbus_message_append_args(msg, DBUS_TYPE_STRING,
> &bdaddress,DBUS_TYPE_INVALID);
> reply = dbus_connection_send_with_reply_and_block(conn, msg, -1,
> &err);
>  if (reply == NULL) {
>  printf("Error %s\n", err.message);
> 
>   }
>  else {
>  dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &name,
> DBUS_TYPE_INVALID);
>                 PBLOG_INFO("%s\n", name);
> }
> 
> all works well till I change the name of the remote device (a phone).
> Each time I run the program I still get the old name, no matter how
> can try. 
> Only workaround I got to solve this is to manually invoke hcitool name
> <bdaddress> to change the actual name in cache.

the name resolving operation is an expensive operation. It always
involves a low-level baseband page. So we try to avoid these kind of
operation whenever possible. This means that we return the cached name
all the time. However the cache will be automatically updated when you
actually connect to the remote device or if extended inquiry (a new
Bluetooth 2.1 feature) is used.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] clearing remote name cache
  2007-03-27 10:32 ` Marcel Holtmann
@ 2007-03-27 12:44   ` Emanuele Novelli
  2007-03-31 14:00     ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Emanuele Novelli @ 2007-03-27 12:44 UTC (permalink / raw)
  To: BlueZ users


[-- Attachment #1.1: Type: text/plain, Size: 1940 bytes --]

2007/3/27, Marcel Holtmann <marcel@holtmann.org>:
>
> Hi Emanuele,
>
> > Hi using the hints about reading remote names from various threads I
> > got on this ML time ago I started experiments with D-Bus API for
> > bluez.
> >
> > I tried to read a remotename in a thread called from another thread
> > who does inquiry.
> > Each time he found a bdaddress he ask for a name
> > (snipped code)
> >
> > msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0",
> > "org.bluez.Adapter", "GetRemoteName");
> > dbus_message_append_args(msg, DBUS_TYPE_STRING,
> > &bdaddress,DBUS_TYPE_INVALID);
> > reply = dbus_connection_send_with_reply_and_block(conn, msg, -1,
> > &err);
> >  if (reply == NULL) {
> >  printf("Error %s\n", err.message);
> >
> >   }
> >  else {
> >  dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &name,
> > DBUS_TYPE_INVALID);
> >                 PBLOG_INFO("%s\n", name);
> > }
> >
> > all works well till I change the name of the remote device (a phone).
> > Each time I run the program I still get the old name, no matter how
> > can try.
> > Only workaround I got to solve this is to manually invoke hcitool name
> > <bdaddress> to change the actual name in cache.
>
> the name resolving operation is an expensive operation. It always
> involves a low-level baseband page. So we try to avoid these kind of
> operation whenever possible. This means that we return the cached name
> all the time. However the cache will be automatically updated when you
> actually connect to the remote device or if extended inquiry (a new
> Bluetooth 2.1 feature) is used.


Ok thanks for  answer,  I'd like  more info about this.
 Are  2.1 compliance dongles already available on the market for end users?
And even if I'll got one of those I guess the remote devices should be
2.1too to answer to an extended inquiry.
What about the Bluez support about the new features of Bluetooth 2.1? (both
low level HCI api and D-bus)

[-- Attachment #1.2: Type: text/html, Size: 2585 bytes --]

[-- Attachment #2: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] clearing remote name cache
  2007-03-27 12:44   ` Emanuele Novelli
@ 2007-03-31 14:00     ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2007-03-31 14:00 UTC (permalink / raw)
  To: BlueZ users

Hi Emanuele,

> Ok thanks for  answer,  I'd like  more info about this. 
>  Are  2.1 compliance dongles already available on the market for end
> users? 

no. However in most cases a firmware update for the BlueCore4 chips is
fully enough. So my guess is that Apple will update their built-in
dongles once the specification has been made public.

> And even if I'll got one of those I guess the remote devices should be
> 2.1 too to answer to an extended inquiry.

You need to have both sides support extended inquiry and the host stack
must set the new attributes to make this work. BlueZ is already doing
this if it finds a Bluetooth 2.1 dongle.

> What about the Bluez support about the new features of Bluetooth 2.1?
> (both low level HCI api and D-bus) 

The extended inquiry is fully support. For the D-Bus API you see
actually no difference since all this stuff is hidden. However it works
perfectly fine.

The support for simple pairing from Bluetooth 2.1 has not been published
and will only be published once the specification is public.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-31 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 10:00 [Bluez-users] clearing remote name cache Emanuele Novelli
2007-03-27 10:32 ` Marcel Holtmann
2007-03-27 12:44   ` Emanuele Novelli
2007-03-31 14:00     ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.