INNER CODE UNIT · Rust

init

qaul/qaul.net · rust/ble_module/src/lib.rs:21

pub fn init(sys_rpc_callback: Box<dyn FnMut(Vec<u8>) + Send>, rpc_receiver: rpc::BleRpc) {
    thread::spawn(move || {
        let rt = runtime::Builder::new_current_thread()
            .enable_all()
            .build()
            .expect("Failed to create BLE module tokio runtime!");

        let local = tokio::task::LocalSet::new();
        local.block_on(&rt, async move {
            main_loop(sys_rpc_callback, rpc_receiver).await;
        });
    });
}

pub async fn is_ble_enabled() -> bool {
    return IdleBleService::is_ble_enabled().await;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…