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
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mavlink-codec = { git = "https://github.com/bluerobotics/rust-mavlink-codec", ha
regex = { version = "1.10.6", features = ["std", "unicode-perl"] }
serde = { version = "1", features = ["rc"] }
serde_derive = "1"
serde_json = "1"
serde_json = { version = "1", features = ["preserve_order"] }
serde_urlencoded = "0.7"
shellexpand = "3.1"
tokio = { version = "1", features = ["full"] }
Expand Down
16 changes: 7 additions & 9 deletions src/lib/drivers/rest/data.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::{
collections::HashMap,
sync::{Arc, Mutex},
};
use std::sync::{Arc, Mutex};

use indexmap::IndexMap;
use lazy_static::lazy_static;
use mavlink::{self, Message};
use serde::{Deserialize, Serialize};
Expand All @@ -22,7 +20,7 @@ struct Data {

#[derive(Debug, Default, Deserialize, Serialize)]
pub struct MAVLinkVehiclesData {
vehicles: HashMap<u8, MAVLinkVehicleData>,
vehicles: IndexMap<u8, MAVLinkVehicleData>,
}

impl MAVLinkVehiclesData {
Expand All @@ -32,7 +30,7 @@ impl MAVLinkVehiclesData {
.entry(vehicle_id)
.or_insert(MAVLinkVehicleData {
id: vehicle_id,
components: HashMap::new(),
components: IndexMap::new(),
})
.update(message);
}
Expand All @@ -58,7 +56,7 @@ impl MAVLinkVehiclesData {
#[derive(Debug, Deserialize, Serialize)]
struct MAVLinkVehicleData {
id: u8,
components: HashMap<u8, MAVLinkVehicleComponentData>,
components: IndexMap<u8, MAVLinkVehicleComponentData>,
}

impl MAVLinkVehicleData {
Expand All @@ -68,7 +66,7 @@ impl MAVLinkVehicleData {
.entry(component_id)
.or_insert(MAVLinkVehicleComponentData {
id: component_id,
messages: HashMap::new(),
messages: IndexMap::new(),
})
.update(message);
}
Expand All @@ -77,7 +75,7 @@ impl MAVLinkVehicleData {
#[derive(Debug, Deserialize, Serialize)]
struct MAVLinkVehicleComponentData {
id: u8,
messages: HashMap<String, MAVLinkMessageStatus>,
messages: IndexMap<String, MAVLinkMessageStatus>,
}

impl MAVLinkVehicleComponentData {
Expand Down
Loading