Crates.io | bms-sm |
lib.rs | bms-sm |
version | 0.1.2 |
source | src |
created_at | 2024-03-16 22:41:19.844561 |
updated_at | 2024-04-03 12:56:12.402663 |
description | Read BMS Shared Memory |
homepage | |
repository | https://github.com/aviinl/bms-rs |
max_upload_size | |
id | 1176055 |
size | 34,262 |
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)