Skip to main content

Crate reai_board_sdk

Crate reai_board_sdk 

Source
Expand description

§ReAI Vibe Board Hardware SDK (V2)

English: An embeddable Rust crate that encapsulates USB/BLE connectivity, auto-reconnect, the HID protocol, mSBC decoding, and USB Audio capture for the ReAI Vibe Board hardware family. Designed to be embedded into any host application that needs to talk to the board.

Product site: https://b.reai.com

简体中文: 封装 USB/BLE 连接、断线重连、HID 协议、mSBC 解码、USB Audio 采集能力的 Rust crate,可嵌入任意应用。

§V2 Architecture (four layers)

  • kernel — pure logic kernel (protocol / events / errors / sink / mSBC / aggregator). No threads, no I/O.
  • runtime — tokio async orchestration (device lifecycle / hotplug / USB / BLE I/O)
  • facadeBoardDevice high-level entry point, three event flavors (events() / on_event() / subscribe())
  • tool — I/O-aware helpers (device-info parsing, mSBC file decoding)

runtime/facade require at least one of usb / ble. With both disabled only kernel/tool are available (lightweight protocol layer).

§Hardware targets

Protocol constants (USB VID/PID, BLE GATT service UUIDs, command opcodes) are tuned for the ReAI Vibe Board hardware family. See module-level docs for details; they are not generic USB/BLE abstractions.

Re-exports§

pub use kernel::error::BoardError;
pub use kernel::error::Result;
pub use kernel::event::FactoryKeyEvent;
pub use kernel::event::BoardEvent;
pub use kernel::event::ModeChangeEvent;
pub use kernel::event::ModeSource;
pub use kernel::protocol_hid::WorkMode;
pub use kernel::protocol_hid::FactoryKeyControlAck;
pub use kernel::protocol_hid::FactoryKeyControlResult;
pub use kernel::sink;
pub use kernel::types::ConnectionType;
pub use facade::device::BoardConfig;
pub use facade::device::BoardDevice;
pub use facade::device::EventListenerHandle;
pub use facade::events::EventStream;
pub use facade::events::EventStreamError;
pub use facade::blocking::BoardDeviceBlocking;
pub use runtime::ble::gatt_client::BleDeviceInfo;

Modules§

dfu
DFU 固件升级(基于固件自定义 USB HID DFU 协议)。
facade
门面层 —— BoardDevice 高级 API,三层事件门面,blocking 桥。
kernel
内核层 —— 纯逻辑,无线程无 IO,无平台依赖。
runtime
编排层 —— tokio async,设备生命周期 / 热插拔 / IO 操作。
tool
工具模块 —— 含 IO 的便利函数(非核心 API)。