public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Yves Paulus <py@idlum.be>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Cached friendly names never updated when changed
Date: Wed, 26 Mar 2008 17:56:54 +0100	[thread overview]
Message-ID: <47EA8056.8090500@idlum.be> (raw)

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Hello,

It seems that once a friendly name has been cached to 
/var/lib/bluetooth/*/names, RemoteNameUpdated signals contain this 
cached name forever, and user is never informed of a name change unless 
those "names" files are deleted.

It can be easily tested using the small python program attached. Just 
start it and play around with your device's friendly name, and with 
/var/lib/bluetooth/*/names (for example simply delete it).

So is there a way to get notified when a device's name has actually 
changed? Maybe I didn't wait long enough? According to the signal's name 
("RemoteNameUpdated"), I would expect to be notified when the name 
actually change.

Best Regards,
Pierre-Yves

[-- Attachment #2: namesresolver.py --]
[-- Type: text/x-python, Size: 731 bytes --]

#!/usr/bin/python

import dbus
import dbus.glib
import gobject

def rem_dev_name_signal(address, name):
        print 'Signal: RemoteNameUpdated(%s, %s)' % (address, name)

def disc_completed_signal():
        adapter.DiscoverDevices()

bus = dbus.SystemBus();

bus.add_signal_receiver(rem_dev_name_signal, 'RemoteNameUpdated', 'org.bluez.Adapter', 'org.bluez', '/org/bluez/hci0')
bus.add_signal_receiver(disc_completed_signal, 'DiscoveryCompleted', 'org.bluez.Adapter', 'org.bluez', '/org/bluez/hci0')

obj = bus.get_object('org.bluez', '/org/bluez/hci0')
adapter = dbus.Interface(obj, 'org.bluez.Adapter')

adapter.DiscoverDevices()

gobject.threads_init()
dbus.glib.init_threads()
main_loop = gobject.MainLoop()
main_loop.run()

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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

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

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

             reply	other threads:[~2008-03-26 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26 16:56 Pierre-Yves Paulus [this message]
2008-03-26 17:05 ` [Bluez-devel] Cached friendly names never updated when changed Marcel Holtmann
2008-03-27 13:11   ` Pierre-Yves Paulus
2008-03-27 15:06     ` Marcel Holtmann
2008-03-27 15:24       ` Pierre-Yves Paulus
2008-03-27 15:45         ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EA8056.8090500@idlum.be \
    --to=py@idlum.be \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox