bcms

Crates.iobcms
lib.rsbcms
version0.1.8
created_at2025-07-02 00:15:26.256903+00
updated_at2025-07-02 11:10:53.036887+00
descriptionBluetooth Client Manager Service for IoT device management
homepagehttps://gofranz.com/
repositoryhttps://github.com/franzos/rust-bcms
max_upload_size
id1734252
size293,255
Franz Geffke (franzos)

documentation

README

BCMS Rust

Bluetooth device manager with BLE discovery, data collection, and API integration.

Features

  • BLE device discovery and management
  • Health data collection (blood pressure, heart rate, etc.)
  • RPC interface for external applications
  • Stats monitoring endpoint

Libraries Usage

Add to your Cargo.toml:

[dependencies]
bpms = "0.1"

Use in your code:

use bcms::{RpcHelper, RpcDeviceInfo, iot_helpers};

// Connect and submit data
let rpc = RpcHelper::new("127.0.0.1:4567".parse()?);
let device = RpcDeviceInfo::new("68:4E:83:32:22".to_string(), "Smartwatch".to_string(), "bluetooth_le".to_string());
let data = iot_helpers::create_temperature_data(device.address.clone(), 23.5, iot_helpers::current_timestamp());
let (success, errors) = rpc.submit_single_data(device, data).await?;

See src/bin/rpc-example.rs for complete example.

CLI Usage

guix shell rust rust-cargo pkg-config gcc-toolchain dbus openssl capnproto
export OPENSSL_DIR=$(dirname $(dirname $(realpath $(which openssl))))
export CC=gcc

./target/debug/bcms-daemon --help

Run the daemon with:

./target/debug/bcms-daemon

Run the CLI with:

./target/debug/bcms --help

List devices:

./target/debug/bcms list

Submit sample data:

$ ./target/debug/rpc-example --device-address 68:4E:83:32:22 --device-name Smartwatch --connection-type bluetooth_le
🩺 BCMS RPC IoT Data Submission Example
📍 Device: Smartwatch (68:4E:83:32:22) - Type: bluetooth_le
🔗 RPC Server: 127.0.0.1:4567
📊 Generating 1 blood pressure reading(s)...

📈 Reading #1: 115mmHg / 60mmHg (timestamp: 1751413581)
✅ Successfully submitted reading #1

📋 Submission Summary:
✅ Successful: 1
❌ Failed: 0
📊 Total: 1

Get stats:

$ ./target/debug/stats-example
📈 System Statistics:
   📊 Total Data Points: 1
   🔧 Total Devices: 1

🔍 Device Details:
  1. 📱 Smartwatch (68:4E:83:32:22)
     • Type: bluetooth_le
     • Approved: ✅
     • Paired: ❌
     • Backend Registered: ❌
     • Last Seen: 2025-07-01 23:46:21 UTC
     • Data Types:
       - blood_pressure: 1 samples (latest: 2025-07-01 23:46:21 UTC)
Commit count: 0

cargo fmt