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

Module device_node

Module device_node 

Source
Expand description

Bluetooth HCI device node for userland access

Provides /dev/bluetooth/hci0 as a device node that allows the BlueZ userland shim to send HCI command packets and receive HCI event packets via the kernel Bluetooth HCI driver.

The device node acts as a bridge between the userland D-Bus daemon (userland/bluez/bluez-hci-bridge.cpp) and the kernel HCI controller (kernel/src/drivers/bluetooth/hci.rs).

Protocol:

  • Write: userland sends H4 HCI command packets (type=0x01 + header + params)
  • Read: userland receives H4 HCI event packets (type=0x04 + header + params)
  • Ioctl: adapter info queries and scan mode configuration

Structs§

BtDeviceHandle
Handle returned by bt_device_open

Constants§

BT_DEVICE_PATH
Device node path
BT_IOCTL_GET_ADAPTER_INFO
Get adapter info (address, name, state)
BT_IOCTL_RESET
Reset the HCI controller
BT_IOCTL_SET_SCAN_MODE
Set scan mode (0=off, 1=inquiry, 2=page, 3=both)

Functions§

bt_device_close
Close the Bluetooth HCI device node handle.
bt_device_ioctl
Perform an ioctl on the Bluetooth device node.
bt_device_open
Open the Bluetooth HCI device node. Returns a handle for subsequent read/write/ioctl operations.
bt_device_read
Read the next HCI event from the kernel event queue.
bt_device_write
Write an HCI command packet to the kernel HCI layer.
init
Initialize the Bluetooth device node subsystem. Creates the /dev/bluetooth/hci0 device node entry. Must be called after the Bluetooth controller is initialized.
pending_event_count
Get the number of pending events in the queue.
push_event
Push an HCI event into the device node’s event queue.