3 releases

0.1.2 Apr 3, 2024
0.1.1 Mar 16, 2024
0.1.0 Mar 16, 2024

#9 in #right

Download history 263/week @ 2024-03-16 16/week @ 2024-03-23 168/week @ 2024-03-30 29/week @ 2024-04-06

476 downloads per month

MIT license

32KB
576 lines

BMS Shared Memory

Crates.io

Read BMS shared memory data

Quick example:

use bms_sm::*;
use std::time::Duration;
use tokio::time::sleep;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    // Wait until the memory-file exists
    let mut mem = IntellivibeData::new();
    loop {
        if mem.is_ok() {
            break;
        }
        sleep(Duration::from_millis(300)).await;
        mem = IntellivibeData::new();
    }
    let mem = mem?;

    // Threadable
    tokio::spawn(async move {
        loop {
            // Read the memory as it is right now
            dbg!(mem.read());
            sleep(Duration::from_secs(5)).await;
        }
    });

    tokio::signal::ctrl_c().await?;

    Ok(())
}

Currently implemented interfaces:

  • IntellivibeData (FalconSharedMemoryArea)
  • FlightData (FalconIntellivibeSharedMemoryArea)
  • StringsData (FalconSharedMemoryAreaString)

Dependencies

~140MB
~2M SLoC