deviceplug / btleplug

Rust Cross-Platform Host-Side Bluetooth LE Access Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Implementatnion in Win10

MackoLysy opened this issue · comments

Im trying to connect this lib via c++ in windows but i have some issues.

  • First thing is thtat its dosent disconnect properly.
  • Second error i that my code throw expetion here:
manager.unwrap().await;

As i check lib implementation you dont check if something goes wrong here

impl api::Manager for Manager {
    type Adapter = Adapter;

    async fn adapters(&self) -> Result<Vec<Adapter>> {
        let mut result: Vec<Adapter> = vec![];
        let radios = Radio::GetRadiosAsync().unwrap().await.unwrap();

        for radio in &radios {
            let kind = radio.Kind().unwrap();
            if kind == RadioKind::Bluetooth {
                result.push(Adapter::new());
            }
        }
        return Ok(result);
    }
}

Rest part works fine :)