[Gllug] Wanted - some bluetooth pointers

Russell Howe rhowe at siksai.co.uk
Sun Jul 9 00:13:36 UTC 2006


On Wed, Jul 05, 2006 at 05:44:34PM +0100, John Winters wrote:
> What sort of tools should I be attempting to use to transfer files
> between PC and phone?  Is there a decent primer *anywhere* on the basic
> concepts of bluetooth communications?  I've done an awful lot of Google
> searching but none of the pages which I've found seems to cover the
> basics.

Well like you, I don't know much about bluetooth either, but this is
what I think I know:

Bluetooth devices advertise various capabilities. The one you probably
want for file transfer is OBEX (OBject EXchange). There's a program
called obexftp for this, and I apt-getted some GNOME bluetooth package
which gave me a nice little "send to bluetooth device" right-click
option in Nautilus.

My bluetooth devices are a keyboard and mouse, which are HID (Human
Interface Devices). They come with a bluetooth dongle which doubles up
as the mouse charger, connecting to the PC via USB.

Initially this pretends to be a normal USB mouse & keyboard on a USB
hub and it does all the bluetooth protocol using a built-in bluetooth
stack, totally transparently to the PC.

In order for the OS to take over operation of the bluetooth protocol,
the bluetooth dongle needs to be switched into a mode whereby it
presents itself as a USB bluetooth adapter. This is done via a program
called 'hid2hci'

Once this is done, the keyboard & mouse won't work until Linux takes
over control of the bluetooth protocol, the units pair up with the
kernel bluetooth stack (called bluez, although there is/was another
around at some point) and the kernel starts to talk the HCI protocol to
them (Human Computer Interaction, one would presume). If this doesn't
happen automatically, "hidd --connect <btaddr>" should pair the devices
up (<btaddr> is a mac address-like address printed on most bluetooth
devices).

There's a program called hciconfig which works somewhat like ifconfig
does, except it deals with hci interfaces (hci0, hci1, etc) instead of
network interfaces (normally you'd only have one hci interface, hci0,
unless you had multiple bluetooth transceivers plugged into the PC).

There's a program called hcidump which dumps traffic on the HCI
interface, much like tcpdump dumps network traffic.

There are extra patches to the kernel (or used to be a few months ago)
which contain minor updates and fixes to the bluetooth stack, but ones
which can be quite important. They are on bluez.org somewhere and have a
-mh<n> suffix (e.g. -mh3). Always worth applying, as they're pretty much
always bugfixes and feature enhancements.

I think hciconfig will tell you what features you have available

I'm sure there's more, but I'm just running in USB HID mode at the
moment, and haven't touched bluetooth stuff for a few months.

-- 
Russell Howe       | Why be just another cog in the machine,
rhowe at siksai.co.uk | when you can be the spanner in the works?
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list