Specifications
CHAPTER 2. DRIVERS AND INTERFACES 10
Bluetooth devices (“BT Devices”) are connected to a Bluetooth host controller (“BT HC”)
which is attached to the system as described above. The host controllers are driven by the
corresponding Bluetooth host controller drivers. The Linux Bluetooth protocol stack BlueZ
(http://www.bluez.org) implements the Bluetooth subsystem consisting of the Bluetooth
Core, the Bluetooth host controller interface (“BT HCI”) and several modules which are used
to implement the various Bluetooth profiles. The Bluetooth HID profile is implemented by
the Human Interface Device Protocol (“HIDP”). Bluetooth HID are registered by the HIDP
driver at the Linux input core. Once again, this is done by calling input core’s function
input register device(). HIDP depends on the Logical Link Control and Adaptation Pro-
tocol (L2CAP). This protocol provides a layer for connection-oriented and connectionless data
transport to Bluetooth devices.
In contrast to USB, connections between Bluetooth devices and the host controller are
initiated from user space. Utilities are available from http://www.bluez.org/download.html.
To enable Bluetooth support for the Linux kernel it is necessary to set the configura-
tion option CONFIG BT to either y (compile static into kernel) or m (compile as module).
Bluetooth HID devices require HIDP (CONFIG BT HIDP) which depends on L2CAP support
(CONFIG BT L2CAP). At the time of writing the following Bluetooth host controllers are sup-
ported by Linux:
– USB: Bluetooth host controllers with USB interface (CONFIG BT HCIUSB), AVM Blue-
FRITZ! USB (CONFIG BT HCIBFUSB)
– PCMCIA or Compact Flash: Nokia DTL1 (CONFIG BT HCIDTL1), 3Com BT3C used on
3Com Bluetooth Card and HP Bluetooth Card (CONFIG BT HCIBT3C), Anycom BlueCard
(CONFIG BT HCIBLUECARD) and Xircom CreditCard Bluetooth Adapter, Xircom Real-
Port2 Bluetooth Adapter, Sphinx PICO Card, H-Soft blue+Card, Cyber-blue Compact
Flash Card (CONFIG BT HCIBTUART)
– UART: Bluetooth host controllers with a serial port interface (CONFIG BT HCIUART)
2.5 Event Interface
Linux offers a generic event interface which gives user space access to input devices. This event
interface is implemented by evdev.c which is found in the directory drivers/input. For each
input device which uses the input core, the event interface registers at least one device node in
/dev/input/. The devices allocated by the event interface are named eventn with n running
from 0 to EVDEV MINORS−1. By default, EVDEV MINORS equals 32 which means that up to 32
input devices can be handled by the event interface, namely event0. . . event31.
The event interface driver registers itself as an event handler using the input core’s func-
tion input register handler(). Input events from the input device drivers are passed to the
corresponding eventn device. User space applications can read input events by opening a file
descriptor for /dev/input/eventn (e.g. using open(2)) and afterwards performing read(2)
on the file descriptor. In case of an input event, applications reading from /dev/input/eventn
receive structures of the type input event. It is possible to use both blocking and non-blocking
reads on the /dev/input/eventn device nodes. Furthermore, it is p ossible to perform oper-
ations on input devices using ioctl(2). The valid ioctl(2) requests for the event interface
are defined in <linux/input.h>.