Skip to content

Commit bd5fe19

Browse files
committed
Add serialization/deserialization for BleDevice
1 parent 4b7e049 commit bd5fe19

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ serde = { version = "1.0", features = ["derive"], optional = true }
7171
serde_json = { version = "1.0", optional = true }
7272
thiserror = "2.0.11"
7373
uuid = { version = "1.12.1", optional = true }
74-
btleplug = { version = "0.11.7", optional = true }
74+
btleplug = { version = "0.11.7", optional = true, features = ["serde"] }
7575
futures = { version = "0.3.31", optional = true }
7676

7777
#TODO: drop pinning of the bluez-async version once we move the MSRV to 1.84 and we can use

src/connections/ble_handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use btleplug::platform::{Adapter, Manager, Peripheral};
66
use futures::stream::StreamExt;
77
use futures_util::stream::BoxStream;
88
use log::error;
9+
use serde::{Deserialize, Serialize};
910
use std::fmt::Display;
1011
use std::future;
1112
use std::str::FromStr;
@@ -87,7 +88,7 @@ impl Display for BleId {
8788
}
8889

8990
/// A Meshtastic device discovered via Bluetooth LE.
90-
#[derive(Clone, PartialEq, Eq, Debug)]
91+
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
9192
pub struct BleDevice {
9293
/// The broadcast name of the device.
9394
pub name: Option<String>,

0 commit comments

Comments
 (0)