Skip to main content

Crate brainwires_hardware

Crate brainwires_hardware 

Source
Expand description

§brainwires-hardware

Hardware I/O for the Brainwires Agent Framework.

Provides a unified hardware abstraction layer covering:

ModuleFeature flagDescription
[audio]audioAudio capture/playback, STT, TTS (16 cloud providers + local Whisper)
[gpio]gpioGPIO pin management with safety allow-lists and PWM (Linux)
[bluetooth]bluetoothBLE advertisement scanning and adapter enumeration
[network]networkNIC enumeration, IP config, ARP discovery, port scanning
[camera]cameraWebcam/camera frame capture (V4L2/AVFoundation/MSMF)
[usb]usbRaw USB device enumeration and bulk/control/interrupt transfers
[homeauto]homeautoHome automation: Zigbee (EZSP+ZNP), Z-Wave, Thread (OTBR), Matter

§Feature flags

[dependencies]
brainwires-hardware = { version = "0.10", features = ["audio", "gpio", "bluetooth", "network"] }
# or enable everything:
brainwires-hardware = { version = "0.10", features = ["full"] }

§Audio

The audio feature enables hardware audio capture/playback via CPAL and 16 cloud STT/TTS provider integrations. Add local-stt for offline Whisper inference and flac for FLAC codec support.

§GPIO (Linux)

The gpio feature exposes safe GPIO pin access using the Linux character device API (gpio-cdev) with an explicit allow-list safety policy.

§Bluetooth

The bluetooth feature uses btleplug for cross-platform BLE scanning (Linux/BlueZ, macOS CoreBluetooth, Windows WinRT).

§Network

The network feature provides interface enumeration, IP configuration parsing, ARP-based host discovery, and async TCP port scanning.

§Camera

The camera feature enables video frame capture using nokhwa: V4L2 on Linux, AVFoundation on macOS, Media Foundation on Windows.

§USB

The usb feature provides raw USB device enumeration and transfers via nusb — a pure-Rust async USB library with no libusb system dependency.