kondis

Crates.iokondis
lib.rskondis
version0.3.2
created_at2025-08-29 11:53:58.230733+00
updated_at2025-08-29 17:31:26.154602+00
descriptiona simple library to communicate with exercise equipment
homepage
repositoryhttps://github.com/chinatsu/kondis
max_upload_size
id1815751
size57,401
Kent Daleng (chinatsu)

documentation

https://docs.rs/kondis

README

kondis

kondis [n, slang] physical condition

a simple library to communicate with exercise equipment

supports

  • iConsole+0028
    • set target cadence (RPM)
    • set target power (W)
    • read FTMS data (kind of, incomplete)

usage

cargo add kondis

also, needs tokio and wants anyhow.

use kondis::equipment_type_to_equipment;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let (shutdown_tx, mut shutdown_rx) = channel();
    tokio::spawn(async move {
        tokio::signal::ctrl_c().await.unwrap();
        shutdown_tx.send(()).unwrap();
    });

    let mut equipment = equipment_type_to_equipment(
        EquipmentType::NonBluetoothDevice,
        32,
        &mut shutdown_rx,
    )
    .await
    .unwrap();
    if !equipment.connect().await? {
        return Ok(());
    }
    loop {
        if let Some(data) = equipment.read().await? {
            let state = format!(
                "{:03} rpm :: {:03} W :: {:.2} km/h",
                data.cadence, data.power, data.speed
            );
            println!("{state}");
        }
    }
    equipment.disconnect().await?;
}
Commit count: 12

cargo fmt