⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module hci

Module hci 

Source
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
BluetoothController
Main Bluetooth HCI controller
BluetoothStats
Statistics for the Bluetooth controller
DiscoveredDevice
A discovered Bluetooth device
HciCommand
HCI Command packet header + parameters
HciConnection
An active HCI connection
HciEvent
HCI Event packet
HciUsbTransport
USB HCI transport endpoint configuration
L2capHeader
L2CAP header (4 bytes: length + channel ID)
L2capSignalHeader
L2CAP signaling packet header (code + identifier + length)
SdpServiceRecord
SDP service record (stub)

Enums§

AclBoundaryFlag
ACL packet boundary flags
AclBroadcastFlag
ACL packet broadcast flag
ConnectionState
Connection state
ControllerState
Bluetooth controller state
HciEventCode
HCI Event codes
HciPacketType
HCI packet type indicators (UART H4 transport)
L2capSignalCode
L2CAP signaling command codes
Ogf
OpCode Group Field values
ScanEnable
Scan enable modes for HCI_Write_Scan_Enable
SdpPduId
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)