usb-bpm-exporter 0.1.4

USB Blood Pressure Monitor data extraction library and CLI tool
Documentation

USB Blood Pressure Monitor Exporter

Library and CLI tool to connect to USB blood pressure monitors and extract measurements.

Supported devices:

Library Usage

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(())
}

CLI Usage

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