Skip to content
Merged
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
4 changes: 2 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 bluez-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ futures = "0.3.31"
itertools = "0.14.0"
log = "0.4.27"
serde = { version = "1.0.219", features = ["derive"] }
serde-xml-rs = "0.7.1"
serde-xml-rs = "0.8.1"
thiserror = "2.0.12"
tokio = { version = "1.45.1", features = ["rt"] }
uuid = "1.16.0"
Expand Down
20 changes: 15 additions & 5 deletions bluez-async/src/introspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::BluetoothError;

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Node {
#[serde(rename = "@name")]
pub name: Option<String>,
#[serde(rename = "interface", default)]
pub interfaces: Vec<Interface>,
Expand All @@ -14,6 +15,7 @@ pub struct Node {

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Interface {
#[serde(rename = "@name")]
pub name: String,
#[serde(rename = "method", default)]
pub methods: Vec<Method>,
Expand All @@ -27,6 +29,7 @@ pub struct Interface {

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Method {
#[serde(rename = "@name")]
pub name: String,
#[serde(rename = "arg", default)]
pub args: Vec<MethodArg>,
Expand All @@ -36,6 +39,7 @@ pub struct Method {

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Signal {
#[serde(rename = "@name")]
pub name: String,
#[serde(rename = "arg", default)]
pub args: Vec<SignalArg>,
Expand All @@ -45,31 +49,35 @@ pub struct Signal {

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Property {
#[serde(rename = "@name")]
pub name: String,
#[serde(rename = "type")]
#[serde(rename = "@type")]
pub dbustype: String,
#[serde(rename = "@access")]
pub access: Access,
#[serde(rename = "annotation", default)]
pub annotations: Vec<Annotation>,
}

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct MethodArg {
#[serde(rename = "@name")]
pub name: Option<String>,
#[serde(rename = "type")]
#[serde(rename = "@type")]
pub dbustype: String,
#[serde(default = "default_method_arg_direction")]
#[serde(rename = "@direction", default = "default_method_arg_direction")]
pub direction: Direction,
#[serde(rename = "annotation", default)]
pub annotations: Vec<Annotation>,
}

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct SignalArg {
#[serde(rename = "@name")]
pub name: Option<String>,
#[serde(rename = "type")]
#[serde(rename = "@type")]
pub dbustype: String,
#[serde(default = "default_signal_arg_direction")]
#[serde(rename = "@direction", default = "default_signal_arg_direction")]
pub direction: Direction,
#[serde(rename = "annotation", default)]
pub annotations: Vec<Annotation>,
Expand All @@ -85,7 +93,9 @@ fn default_signal_arg_direction() -> Direction {

#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Annotation {
#[serde(rename = "@name")]
pub name: String,
#[serde(rename = "@value")]
pub value: String,
}

Expand Down
Loading