Crate bitalino_rs

Crate bitalino_rs 

Source
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:

  1. Record the start time when calling start()
  2. Use sequence numbers to detect dropped frames
  3. Calculate sample times as: start_time + sample_index / sampling_rate

Structs§

Bitalino
BITalino device driver.
BluetoothConnector
High level connector that opens an RFCOMM socket without needing root.
DeviceState
Device state information (BITalino 2.0+ only).
Frame
A single data frame from the BITalino device.
FrameBatch
Result of reading frames, including timing information.
RfcommStream
Simple RFCOMM stream that behaves like a Read/Write object.

Enums§

BluetoothError
DriverError
SamplingRate
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.