[gnome-bluetooth] bt device chooser dialog in python

Fred Schaettgen kde-bluetooth at schaettgen.de
Wed Aug 10 14:17:28 BST 2005


On Wednesday, 10. August 2005 14:24, Ondrej Ivanič wrote:
> Hi
>
> I'm looking for a magic button in my application. This button show
> dialog box with discovered bluetooth devices and user can simply select
> the right device.
>
> I'm only need parameters for python
> btctl_controller_establish_rfcomm_connection() equivalent as return
> value from dialog window. I was looked into libgnomebt, gnome-bluetooth
> python stuff, but i can't found simple solution.

Probably not an option for you, but kdebluetooth contains a little command 
line tool (kbtsearch) which does exactly that. You can tell it to search for 
all devices or for a given service, it lets the user choose from the results 
and returns the address and rfcomm channel on stdout, like that:

$ kbtsearch --title "Select a handfree device" --uuid HFP
00:E0:03:32:5E:38 13 0x111E

Right now it depends on a running kbluetoothd. There is no deeper technical 
reason for it, but so far we assumed that everybody using it is running 
kbluetoothd anyway.
It's pretty handy for user interaction in scripts though; once bluez has dbus 
interfaces for device discovery and persistent name caches etc it might be a 
good idea to implement such a tool in Qt or GTK+ without gnome or kde 
dependencies...

regards
Fred

-- 
Fred Schaettgen
kde.sch at ttgen.net


More information about the gnome-bluetooth mailing list