How bluekitchen/btstack works
BTstack is an embedded-capable Bluetooth protocol stack, with platform ports that bind a controller transport and run loop to the stack; larger-system deployments also expose a server and language bindings. The principal workflow is an application using Bluetooth services and profiles, through protocol handling and HCI, to a Bluetooth controller. The README documents broad protocol and profile coverage; available source references give more concrete evidence for the POSIX port’s HCI, transport, run-loop, and persistence setup. Unsampled subsystems are represented at their documented level rather than with inferred call chains.
Main entry points: linux/main.c POSIX port · hci.h HCI management · msp432p401lp-cc256x/main.c Embedded ports · hci_transport.h HCI transport API
Components 19
Platform Integration
- POSIX port
port/linux/main.c - Embedded ports
port/msp432p401lp-cc256x/main.c - BTstack server
platform/daemon/src/rfcomm_service_db_memory.c - Java binding
platform/daemon/binding/java/src/com/bluekitchen/btstack/GATTService.java
Stack Core
- HCI management
src/hci.h - HCI transport API
src/hci_transport.h - H4 transport
src/hci_transport_h4.h - Run loop
src/btstack_run_loop.h - Memory pools
src/btstack_memory.h
Protocols and Profiles
- L2CAP and ATT
src/hci.h - Classic profiles
src/classic/avrcp_controller.c - GATT client
src/ble/gatt_client.c - Mesh services
src/mesh/gatt-service/mesh_provisioning_service_server.c
GATT Services
- GATT services
src/ble/gatt-service/object_transfer_service_server.c
State and Diagnostics
- TLV storage
src/ble/le_device_db_tlv.h - Link-key storage
src/classic/btstack_link_key_db_tlv.h - HCI diagnostics
src/hci_dump.h
Other components
- Bluetooth application
- Bluetooth controller
Connections 19
- Bluetooth application → POSIX port: uses port
- Bluetooth application → Embedded ports: uses port
- POSIX port → HCI management: configures
port/linux/main.c - POSIX port → HCI transport API: selects transport
port/linux/main.c - POSIX port → Run loop: initializes
port/linux/main.c - Embedded ports → HCI management: configures
port/msp432p401lp-cc256x/main.c - Embedded ports → HCI transport API: selects transport
port/msp432p401lp-cc256x/main.c - HCI management → Bluetooth controller: exchanges HCI packets
- HCI transport API → H4 transport: specializes
src/hci_transport_h4.h - HCI management → L2CAP and ATT: coordinates protocols
src/hci.h - Bluetooth application → Classic profiles: uses profiles
- Bluetooth application → GATT client: uses client
- Bluetooth application → GATT services: uses services
- Bluetooth application → Mesh services: uses mesh
- POSIX port → TLV storage: configures storage
port/linux/main.c - POSIX port → Link-key storage: configures storage
port/linux/main.c - POSIX port → HCI diagnostics: configures dump
port/linux/main.c - BTstack server → Bluetooth application: serves clients
- Bluetooth application → Java binding: accesses via binding