| Crates.io | usb-bpm-exporter |
| lib.rs | usb-bpm-exporter |
| version | 0.1.4 |
| created_at | 2025-07-01 23:29:46.60674+00 |
| updated_at | 2025-07-01 23:29:46.60674+00 |
| description | USB Blood Pressure Monitor data extraction library and CLI tool |
| homepage | https://gofranz.com/ |
| repository | https://github.com/franzos/usb-bpm-exporter |
| max_upload_size | |
| id | 1734216 |
| size | 33,469 |
Library and CLI tool to connect to USB blood pressure monitors and extract measurements.
Supported devices:
Add to your Cargo.toml:
[dependencies]
usb-bpm-exporter = "0.1"
Use in your code:
use usb_bpm_exporter::{Device, Result};
fn main() -> Result<()> {
let mut device = Device::new("/dev/ttyACM0")?;
// Get measurement count for user 1
let count = device.count(1)?;
println!("User has {} measurements", count);
// Get all observations for user 1
let observations = device.observations(1)?;
for obs in observations {
if let Some(datetime) = obs.datetime() {
println!("{}: {}/{} mmHg, pulse {}",
datetime, obs.systolic, obs.diastolic, obs.pulse);
}
}
Ok(())
}
guix shell rust rust-cargo gcc-toolchain pkg-config eudev
cargo build
Start with debugging enabled; where /dev/ttyACM0 is the serial port, and 1 the user:
$ sudo ./target/debug/usb-bpm-exporter /dev/ttyACM0 1
User,Date,Hour,Regular Heart Beat,Systolic,Diastolic,Pulse,Body Movement,Incorrect Cuff Wrapping,Unsuitable Temperature,Usable Measurement
1,2024-04-07,08:34,1,95,70,65,0,0,0,1
1,2024-04-07,08:08,0,95,64,64,0,0,0,1