Expand description
Bluetooth HCI (Host Controller Interface) Driver
Implements the HCI transport layer, command/event protocol, device discovery, connection management, L2CAP basics, and SDP service discovery stubs.
Reference: Bluetooth Core Specification v5.4, Volume 4 (HCI)
Structs§
- AclHeader
- ACL Data packet header
- Bluetooth
Controller - Main Bluetooth HCI controller
- Bluetooth
Stats - Statistics for the Bluetooth controller
- Discovered
Device - A discovered Bluetooth device
- HciCommand
- HCI Command packet header + parameters
- HciConnection
- An active HCI connection
- HciEvent
- HCI Event packet
- HciUsb
Transport - USB HCI transport endpoint configuration
- L2cap
Header - L2CAP header (4 bytes: length + channel ID)
- L2cap
Signal Header - L2CAP signaling packet header (code + identifier + length)
- SdpService
Record - SDP service record (stub)
Enums§
- AclBoundary
Flag - ACL packet boundary flags
- AclBroadcast
Flag - ACL packet broadcast flag
- Connection
State - Connection state
- Controller
State - Bluetooth controller state
- HciEvent
Code - HCI Event codes
- HciPacket
Type - HCI packet type indicators (UART H4 transport)
- L2cap
Signal Code - L2CAP signaling command codes
- Ogf
- OpCode Group Field values
- Scan
Enable - Scan enable modes for HCI_Write_Scan_Enable
- SdpPdu
Id - SDP PDU IDs
Constants§
- ACL_
MAX_ DATA_ LEN - Maximum ACL data payload
- BD_
ADDR_ ZERO - Zero / unset BD_ADDR
- GIAC_
LAP - General Inquiry Access Code LAP (GIAC)
- HCI_
CREATE_ CONNECTION - HCI_Create_Connection (OGF=0x01, OCF=0x0005)
- HCI_
DISCONNECT - HCI_Disconnect (OGF=0x01, OCF=0x0006)
- HCI_
INQUIRY - HCI_Inquiry (OGF=0x01, OCF=0x0001)
- HCI_
MAX_ COMMAND_ PARAMS - Maximum HCI command parameter length
- HCI_
MAX_ EVENT_ PARAMS - Maximum HCI event parameter length
- HCI_
READ_ BD_ ADDR - HCI_Read_BD_ADDR (OGF=0x04, OCF=0x0009)
- HCI_
READ_ LOCAL_ NAME - HCI_Read_Local_Name (OGF=0x03, OCF=0x0014)
- HCI_
RESET - HCI_Reset (OGF=0x03, OCF=0x0003)
- HCI_
WRITE_ SCAN_ ENABLE - HCI_Write_Scan_Enable (OGF=0x03, OCF=0x001A)
- L2CAP_
CID_ ATT - L2CAP ATT (Attribute Protocol) fixed channel CID
- L2CAP_
CID_ CONNECTIONLESS - L2CAP connectionless channel CID
- L2CAP_
CID_ LE_ SIGNALING - L2CAP LE Signaling channel CID
- L2CAP_
CID_ SIGNALING - L2CAP signaling channel CID
- L2CAP_
CID_ SMP - L2CAP SMP (Security Manager Protocol) fixed channel CID
- LIAC_
LAP - Limited Inquiry Access Code LAP (LIAC)
- MAX_
CONNECTIONS - Maximum number of simultaneous connections
- MAX_
DISCOVERED_ DEVICES - Maximum number of discovered devices
- MAX_
SDP_ RECORDS - Maximum number of SDP service records
- UUID_
A2DP_ SINK - UUID_
A2DP_ SOURCE - UUID_
HFP - UUID_
HID - UUID_
L2CAP - UUID_
OBEX_ PUSH - UUID_
RFCOMM - UUID_
SDP - Common Bluetooth UUIDs (16-bit short form)
- UUID_
SERIAL_ PORT
Functions§
- init
- Initialize the HCI subsystem (called from bluetooth::init)
- make_
opcode - Build an HCI opcode from OGF and OCF fields Format: bits [15:10] = OGF, bits [9:0] = OCF
- opcode_
ocf - Extract OCF from an HCI opcode
- opcode_
ogf - Extract OGF from an HCI opcode
Type Aliases§
- BdAddr
- Bluetooth device address (6 bytes, little-endian)