bcms 0.1.12

Bluetooth Client Manager Service for IoT device management
Documentation
# 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`:

```toml
[dependencies]
bpms = "0.1"
```

Use in your code:


```rust
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

### Build

```bash
guix shell -m manifest.scm
cargo build
```

### Run

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

Run the daemon with:

```bash
./target/debug/bcms-daemon
```

Run the CLI with:

```bash
./target/debug/bcms --help
```

List devices:

```bash
./target/debug/bcms list
```

Submit sample data:

```bash
$ ./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:

```bash
$ ./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)
```