Expand description
BITalino Rust driver with Python bindings.
This crate provides a robust interface to BITalino biosignal acquisition devices via Bluetooth RFCOMM using a minimal libc-based stack. It uses a raw RFCOMM socket and expects the device to be pre-paired/trusted (you provide the MAC); no BlueZ/tokio/dbus dependencies or privileged operations are required.
§Timing and Synchronization
The BITalino device samples at a precise rate controlled by its internal crystal. However, Bluetooth introduces variable latency. For accurate timing reconstruction:
- Record the start time when calling
start() - Use sequence numbers to detect dropped frames
- Calculate sample times as:
start_time + sample_index / sampling_rate
Structs§
- Bitalino
- BITalino device driver.
- Bluetooth
Connector - High level connector that opens an RFCOMM socket without needing root.
- Device
State - Device state information (BITalino 2.0+ only).
- Frame
- A single data frame from the BITalino device.
- Frame
Batch - Result of reading frames, including timing information.
- Rfcomm
Stream - Simple RFCOMM stream that behaves like a Read/Write object.
Enums§
- Bluetooth
Error - Driver
Error - Sampling
Rate - Supported sampling rates for BITalino acquisition.
Functions§
- init_
python_ logging - Initialize the Python-facing logging bridge so Rust logs flow into Python’s
logging. Safe to call multiple times; a logger is installed on first call. - init_
rust_ logging - Initialize logging for Rust binaries (stderr formatter) based on
BITALINO_LOG/RUST_LOG. - reset_
python_ logging_ cache - Reset the cached per-target Python loggers (call after changing Python logging config).
Type Aliases§
- Result
- Convenience result alias for driver operations.