Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ num_enum = "0.7.4"
half = "2.6.0"
env_logger = "0.11.8"
anyhow = "1.0"
crazyflie-link = { version = "0.5.0", default-features = false }
crazyflie-lib = { version = "0.8.0", default-features = false }
crazyradio = { version = "0.7.0", features = ["async"] }
crazyflie-lib = "0.8.1"
rusb = "0.9"
cfloader = "0.1.0"
clap = { version = "4.5.46", features = ["derive"] }
Expand Down Expand Up @@ -87,8 +85,7 @@ hex = "0.4.3"
chrono = "0.4.44"

[target.'cfg(unix)'.dependencies]
crazyflie-link = { version = "0.5.0", default-features = false, features = ["packet_capture"] }
crazyradio = { version = "0.7.0", features = ["async", "packet_capture"] }
crazyflie-lib = { version = "0.8.1", features = ["packet_capture"] }
Comment on lines 87 to +88

# Used by build.rs to generate shell-completion scripts from the same clap
# command tree as the binary (src/cli.rs is shared via include!).
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ fn is_streaming_command(cmd: &Commands) -> bool {
/// alongside other immutable accesses to `holder`.
async fn connect_cf<'a>(
holder: &'a mut Option<crazyflie_lib::Crazyflie>,
link_context: &crazyflie_link::LinkContext,
link_context: &crazyflie_lib::crazyflie_link::LinkContext,
uri: &str,
toc_cache: ConfigTocCache,
measure_connect_time: bool,
Expand Down Expand Up @@ -545,9 +545,9 @@ async fn run() -> Result<()> {
let toc_cache = ConfigTocCache::new(config.clone(), args.no_toc_cache);

#[cfg(all(unix, feature = "packet_capture"))]
crazyflie_link::capture::init();
crazyflie_lib::crazyflie_link::capture::init();

let link_context = crazyflie_link::LinkContext::new();
let link_context = crazyflie_lib::crazyflie_link::LinkContext::new();

let mut connected_cf: Option<crazyflie_lib::Crazyflie> = None;
let preserve_console = args.preserve_console;
Expand Down Expand Up @@ -1280,12 +1280,12 @@ async fn run() -> Result<()> {
match command {
HlCommands::Arm => {
println!("Arming Crazyflie...");
cf.platform.send_arming_request(true).await?;
cf.supervisor.send_arming_request(true).await?;
println!("Crazyflie armed!");
}
HlCommands::Disarm => {
println!("Disarming Crazyflie...");
cf.platform.send_arming_request(false).await?;
cf.supervisor.send_arming_request(false).await?;
println!("Crazyflie disarmed!");
}
HlCommands::Takeoff(params) => {
Expand Down
8 changes: 4 additions & 4 deletions src/modules/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::{anyhow, bail, Result};
use crazyflie_lib::Crazyflie;
use crazyflie_lib::subsystems::memory::{DeckMemory, MemoryType, RawMemory};
use tokio::time::{sleep, timeout, Duration};
use crazyflie_link::{Connection, LinkContext, Packet};
use crazyflie_lib::crazyflie_link::{Connection, LinkContext, Packet};
use byteorder::{LittleEndian, ByteOrder};

use crate::ConfigTocCache;
Expand Down Expand Up @@ -238,7 +238,7 @@ fn print_target_info(name: &str, info: &BootloaderInfo) {
println!(" CPU ID: 0x{:04X}", info.cpuid);
}

pub async fn print_bootloader_info(link_context: &crazyflie_link::LinkContext, cold: bool, uri: &str) -> Result<()> {
pub async fn print_bootloader_info(link_context: &crazyflie_lib::crazyflie_link::LinkContext, cold: bool, uri: &str) -> Result<()> {

let link = start_bootloader(link_context, cold, uri).await?;

Expand All @@ -258,7 +258,7 @@ pub async fn print_bootloader_info(link_context: &crazyflie_link::LinkContext, c
Ok(())
}

pub async fn reboot(link_context: &crazyflie_link::LinkContext, uri: &str,) -> Result<()> {
pub async fn reboot(link_context: &crazyflie_lib::crazyflie_link::LinkContext, uri: &str,) -> Result<()> {

let link = link_context.open_link(uri).await?;
send_command(&link, BootloaderCommand::ResetInit, None).await?;
Expand Down Expand Up @@ -420,7 +420,7 @@ async fn flash_deck_ctrl(
Ok(())
}

pub async fn flash(link_context: &crazyflie_link::LinkContext, uri: &str, toc_cache: ConfigTocCache, firmware_upgrade: FirmwareUpgrade, cold: bool) -> Result<()> {
pub async fn flash(link_context: &crazyflie_lib::crazyflie_link::LinkContext, uri: &str, toc_cache: ConfigTocCache, firmware_upgrade: FirmwareUpgrade, cold: bool) -> Result<()> {

let firmware_for_bootloader = firmware_upgrade.get_firmware_for_bootloader();
let firmware_for_deckctrl = firmware_upgrade.get_firmware_for_deckctrl();
Expand Down
2 changes: 1 addition & 1 deletion src/modules/crazyradio.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{bail, Result};
use crazyradio::{Channel, Crazyradio, Datarate};
use crazyflie_lib::crazyflie_link::crazyradio::{Channel, Crazyradio, Datarate};
use std::time::Duration;

const CRAZYRADIO_VID: u16 = 0x1915;
Expand Down
14 changes: 7 additions & 7 deletions src/modules/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait StabilityTest {

fn run<'a>(
&'a self,
link_context: &'a crazyflie_link::LinkContext,
link_context: &'a crazyflie_lib::crazyflie_link::LinkContext,
uri: &'a str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand All @@ -37,7 +37,7 @@ impl StabilityTest for ReconnectTest {

fn run<'a>(
&'a self,
link_context: &'a crazyflie_link::LinkContext,
link_context: &'a crazyflie_lib::crazyflie_link::LinkContext,
uri: &'a str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> {
Box::pin(async move {
Expand All @@ -58,7 +58,7 @@ impl StabilityTest for ParamReadReadWriteTest {

fn run<'a>(
&'a self,
link_context: &'a crazyflie_link::LinkContext,
link_context: &'a crazyflie_lib::crazyflie_link::LinkContext,
uri: &'a str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> {
Box::pin(async move {
Expand Down Expand Up @@ -98,7 +98,7 @@ impl StabilityTest for LoggingTest {

fn run<'a>(
&'a self,
link_context: &'a crazyflie_link::LinkContext,
link_context: &'a crazyflie_lib::crazyflie_link::LinkContext,
uri: &'a str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> {
Box::pin(async move {
Expand Down Expand Up @@ -134,7 +134,7 @@ impl StabilityTest for LoggingTest {
}

pub async fn stability(
link_context: &crazyflie_link::LinkContext,
link_context: &crazyflie_lib::crazyflie_link::LinkContext,
uri: &str,
iterations: u32,
) -> Result<()> {
Expand All @@ -148,7 +148,7 @@ pub async fn stability(
}

async fn run_stability_tests(
link_context: &crazyflie_link::LinkContext,
link_context: &crazyflie_lib::crazyflie_link::LinkContext,
uri: &str,
iterations: u32,
tests: Vec<Box<dyn StabilityTest>>,
Expand Down Expand Up @@ -213,7 +213,7 @@ struct RebootTestResult {
}

pub async fn reboot(
link_context: &crazyflie_link::LinkContext,
link_context: &crazyflie_lib::crazyflie_link::LinkContext,
uri: &str,
toc_cache: ConfigTocCache,
iterations: u32,
Expand Down
Loading