This article describes the setup of bluetooth controllers.
Bluez uses udev, so set it up first.
|RFCOMM protocol support||rfcomm||RFCOMM is a requirement of the OBEX-file transfer, dialup connections and more bluetooth applications.|
|RFCOMM TTY support||-||Enables terminal emulator connections over RFCOMM.|
|BNEP protocol support||bnep||Enables network support, e.g. for the PAN profile.|
|Multicast filter support||-||Enables multicast filter support.|
|Protocol filter support||-||Enables protocoll filter support.|
|HIDP protocol support||hidp||Enables input device support. See the Bluetooth Input devices article.|
Portage knows the global USE flag bluetooth for enabling support for Bluetooth in other packages. Enabling this USE flag will pull in net-wireless/bluez automatically:
The USE flags of bluez are:
|alsa||Yes||Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)|
|consolekit||Yes||Use sys-auth/pambase[consolekit] to determine access to bluetooth devices based on whether a user is logged in locally or remotely|
|cups||Yes||Add support for CUPS (Common Unix Printing System)|
|debug||No||Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml|
|gstreamer||No||Adds support for media-libs/gstreamer (Streaming media)|
|pcmcia||No||Adds support for PCMCIA slots/devices found on laptop computers|
|readline||Yes||Enables support for libreadline, a GNU line-editing library that almost everyone wants|
|selinux||No||No||!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur|
|test-programs||No||Install tools for testing of various Bluetooth functions|
|usb||Yes||Adds USB support to applications that have optional USB support (e.g. cups)|
After setting this you want to update your system so the changes take effect:
You can now start bluetooth:
To start bluetooth at boot time, add it your default runlevel:
A broader solution is to add the user you want to be able to access bluetooth devices to the plugdev group:
Before a device can be used, it must be attached (paired in Bluetooth-lingo). This is done by entering a PIN (or other code) on both devices.
In order to pair, you must first have the interaction agent active. Most desktop environments have bluetooth integration so will automatically support the interaction agent. For example, KDE has net-wireless/bluedevil.
Using the simple-agent
Configuration can either be performed using the BlueZ test programs (available if you enable the test-programs USE flag for bluez), or by using the D-Bus API. The first way is described here.
The first step to do is to retrieve the address of the mouse. Most of the devices need you to press a special button, possibly for several seconds, to render them discoverable.
Where 00:1F:20:1D:1B:4B is the MAC address for your device.
The second step to do is to pair the device:
Enter a PIN and press Enter, then enter the same PIN at the device. If you don't know the PIN, then it is probably 0000. It could be 1234.
If you get the following output, it means that you already have an interaction agent running on your system:
The third step is to mark the device as trusted so it can connect automatically:
That should return you to a prompt with no output. To test if it's trusted issue "bluez-test-device trusted 00:1F:20:1D:1B:4B" without yes:
If you get 1 then it is trusted. 0 is the default value (not trusted) - you want that to change to 1 (trusted).
The fourth step is to connect the device (this only needs to be done once, it will be done automatically after that):
This should also return you to a prompt, and the device should now be paired and working.
You are now ready to proceed.