Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.

Commit 6e5dd8e

Browse files
committed
receive the msp handle
1 parent c782cf3 commit 6e5dd8e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ keywords = ["msp", "multiwii", "inav", "betaflight"]
1515

1616
[dependencies]
1717
multiwii_serial_protocol_v2 = "0.1.12"
18-
async_msp_lib = "0.1.14"
18+
async_msp_lib = "0.1.15"
1919
serialport = { git = "https://github.com/Susurrus/serialport-rs" }
2020
packed_struct = "0.3"
2121
packed_struct_codegen = "0.3"

src/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use multiwii_serial_protocol_v2::structs::*;
3636
use std::collections::HashMap;
3737
use packed_struct::PrimitiveEnum;
3838
use async_msp_lib::{Msp, SettingInfo};
39+
use async_msp_lib::core::MspTaskHandle;
3940
use itertools::Itertools;
4041

4142

@@ -398,7 +399,7 @@ async fn main() {
398399
let is_strict = matches.is_present("strict");
399400
let buff = usize::from_str(matches.value_of("buff").unwrap()).unwrap();
400401
let is_verbose = matches.is_present("verbose");
401-
let inav = open_msp(matches.value_of("port"), &flavor, buff, is_verbose);
402+
let (inav, _handle) = open_msp(matches.value_of("port"), &flavor, buff, is_verbose);
402403

403404
match matches.subcommand() {
404405
("setting", Some(setting_matches)) => {
@@ -1694,7 +1695,7 @@ async fn dump_common_setting(inav: &Msp) -> Result<Vec<String>, &str> {
16941695
return Ok(dump);
16951696
}
16961697

1697-
fn open_msp(port: Option<&str>, flavor: &FcFlavor, buff: usize, verbose: bool) -> Msp {
1698+
fn open_msp(port: Option<&str>, flavor: &FcFlavor, buff: usize, verbose: bool) -> (Msp, MspTaskHandle) {
16981699
#[cfg(any(target_os = "windows", target_os = "macos"))]
16991700
let serial_timeout = Duration::from_millis(1);
17001701

0 commit comments

Comments
 (0)