Docs/SysAdmin/Networking/Bluetooth
From Mandriva Community Wiki
Bluetooth is not as mature as a lot of technologies in Linux, but it is possible to get it working without a lot of arcane incantation. I would recommend a couple of useful links:
- http://www.hanscees.com/bluezhowto.html is a HOWTO that maybe spends too much time on dial-up-networking, but is nevertheless most useful.
- http://www.unrooted.net/openSource/bluez/ is more tutorial based, but glosses over a couple of important points.
[edit] Bluetooth Quickstart
These details are prepared against Mandriva 9.2, a Sitecom CN500 USB-Bluetooth Adaptor and an Ericsson T39m phone. They are probably more general than that.
First plug in the bluetooth device and check with lsmod that you have "bluez" loaded. If so the kernel has detected the bluetooth device and you're ready to go.
There are some additions to /etc/modules.conf that you need:
alias net-pf-31 bluez alias bt-proto-0 l2cap alias bt-proto-2 sco alias bt-proto-3 rfcomm alias bt-proto-4 bnep alias tty-ldisc-15 hci_uart alias char-major-10-250 hci_vhci
(that's from the "unrooted" link above.) I don't think you need the first line there, since bluez is already running, but it didn't seem to cause any problems.
You need two daemons running. There is a configuration file in /etc/rc.d/init.d, but I don't think it is included in any runmode. For now you just need to run the two programs hcid and sdpd, no parameters and no output. Dead easy.
Now hciconfig should show an active bluetooth device. If so hcitool scan should find any bluetooth peripherals that are set to be "discoverable" (It's a setting on your phone.) Note down the address of your peripheral that hcitool scan displays, you'll need it.
Now "sdptool --bdaddr xx:xx:xx:xx:xx:xx search SP" will find all serial ports on the peripheral with the given address, (yes, the one you noted above. If you typed the x's kick yourself now,) and attempt to pair with the device. A dialog box will appear on the computer. Type in "123456", then a similar prompt will apear on the peripheral, type in the same number. If all goes well the devices will be paired. Also note the channel numbers on the serial ports that sdptool finds. You'll need one of those too, (it doesn't matter which one.)
We're almost there. "rfcomm bind 0 xx:xx:xx:xx:xx:xx y" where xx... is the address and y is the channel number, will create a link between a /dev device on the computer, and the serial port on the peripheral, but you can't use it easily yet.
Create a symbolic link between /dev/bluetooth/rfcomm/0 (which is what the kernel drivers create,) and /dev/rfcomm0 (which is what you want to use.)
Install "minicom" (urpmi minicom) and configure it to connect to /dev/rfcomm0, the baud rate etc don't matter, but you should probably delete the initialisation strings. If the peripheral is a phone, you should now be able to type "ati" and get the model name of the phone back.
The rest depends on what you want to do and what peripheral you're using. The links above give good pointers, except for the list of AT commands. I did find the T39m document on the web, but since is appears to infringe Sony-Ericsson copyright I'm not putting a link here. Google is your friend.

