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.
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/lib);
kernel modules (/lib/modules/`uname -r`/kernel/{net/bluetooth,drivers/bluetooth}.
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.o | Affix core module (HCI, L2CAP, and its socket interfaces) |
| affix_rfcomm.o | RFCOMM, BTY and its socket interfaces |
| affix_pan.o | PAN (BNEP, network interface) |
| affix_usb.o | Bluetooth USB driver |
| affix_uart.o | Bluetooth UART (H4, BCSP, TLP) driver |
| affix_uart_cs.o | PCMCIA driver for UART cards |