Affix design allows user to implement applications at the kernel level (as kernel modules) and user level (as applications). For this reason Affix exports following interfaces:
Kernel programming interface. A set of functions, which includes HCI, L2CAP, RFCOMM and UART modules.
Socket interface. A first level API that is used to utilize core Bluetooth Protocols like L2CAP and RFCOMM. Use it in the same way as other type of sockets (e.g. PF_INET).
Shared libraries. Various set of functions.
Kernel variables. Use these to get information on the state of Affix and your Bluetooth device. Also you can set several parameters to control Affix. Read more in chapter Debugging Affix.
Affix API components include following entities: incorporated in header files and libraries. Default installation path for header files and libraries is /usr/include/affix and /usr/lib respectively.
Header files (/usr/include/affix)
Libraries (/usr/local/lib)
Kernel modules (/lib/modules/`uname -r`/kernel/{net/affix,drivers/affix}
Table 3-1. Affix header files
Header file | Description |
---|---|
bluetooth.h | Main header file. Has to be included in all programs. Contains main system Affix type definitions and function declarations. Provides interface between kernel and user parts. |
hci_types.h | Contains all HCI type definitions. (defined according to the Bluetooth Specifications). |
hci_cmds.h | Contains HCI commands implementation. (defined according to the Bluetooth Specification). |
btcore.h | Contains user-level Affix system specific definitions and declarations. |
utils.h | Contains declarations of common tools for the Affix. |
sdp.h | Contains SDP type definitions. |
sdpclt.h | Contains SDP client interface declarations. |
sdpsrv.h | Contains SDP server interface declarations. |
obex.h | Contains OBEX client interface declarations. |
Table 3-2. Affix libraries
Library | Description |
---|---|
libaffix.so | Main Affix library. Contains Affix and Bluetooth core implementation. All programs must link with it. |
libaffix_utils.so | Contains implementation of general purpose functions used in the Affix. |
libaffix_sdp.so | Contains SDP client API implementation. Any program using SDP has to link with it. |
libaffix_sdpsvc.so | contains SDP server API implementation. Only programs registering services link with it. |
libaffix_obex.so | Contains Bluetooth OBEX framework implementation. Any program using OBEX must link with it. |
Table 3-3. Affix kernel modules
Module | Description |
---|---|
affix.ko | Affix core module (HCI, L2CAP, and its socket interfaces) |
affix_rfcomm.ko | RFCOMM, BTY and its socket interfaces |
affix_pan.ko | PAN (BNEP, network interface) |
affix_usb.ko | Bluetooth USB driver |
affix_uart.ko | Bluetooth UART (H4, BCSP, TLP) driver |
affix_uart_cs.ko | PCMCIA driver for UART cards |
affix_hidp | HID device support implementation |