1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#[allow(unused_imports)]
use dbus::arg;
use dbus::nonblock;
pub trait OrgBluezGattDescriptor1 {
fn read_value(&self, options: arg::PropMap) -> nonblock::MethodReply<Vec<u8>>;
fn write_value(&self, value: Vec<u8>, options: arg::PropMap) -> nonblock::MethodReply<()>;
fn uuid(&self) -> nonblock::MethodReply<String>;
fn characteristic(&self) -> nonblock::MethodReply<dbus::Path<'static>>;
fn value(&self) -> nonblock::MethodReply<Vec<u8>>;
}
pub const ORG_BLUEZ_GATT_DESCRIPTOR1_NAME: &str = "org.bluez.GattDescriptor1";
#[derive(Copy, Clone, Debug)]
pub struct OrgBluezGattDescriptor1Properties<'a>(pub &'a arg::PropMap);
impl<'a> OrgBluezGattDescriptor1Properties<'a> {
pub fn from_interfaces(
interfaces: &'a ::std::collections::HashMap<String, arg::PropMap>,
) -> Option<Self> {
interfaces.get("org.bluez.GattDescriptor1").map(Self)
}
pub fn uuid(&self) -> Option<&String> {
arg::prop_cast(self.0, "UUID")
}
pub fn characteristic(&self) -> Option<&dbus::Path<'static>> {
arg::prop_cast(self.0, "Characteristic")
}
pub fn value(&self) -> Option<&Vec<u8>> {
arg::prop_cast(self.0, "Value")
}
}
impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target = T>> OrgBluezGattDescriptor1
for nonblock::Proxy<'a, C>
{
fn read_value(&self, options: arg::PropMap) -> nonblock::MethodReply<Vec<u8>> {
self.method_call("org.bluez.GattDescriptor1", "ReadValue", (options,))
.and_then(|r: (Vec<u8>,)| Ok(r.0))
}
fn write_value(&self, value: Vec<u8>, options: arg::PropMap) -> nonblock::MethodReply<()> {
self.method_call("org.bluez.GattDescriptor1", "WriteValue", (value, options))
}
fn uuid(&self) -> nonblock::MethodReply<String> {
<Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
&self,
"org.bluez.GattDescriptor1",
"UUID",
)
}
fn characteristic(&self) -> nonblock::MethodReply<dbus::Path<'static>> {
<Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
&self,
"org.bluez.GattDescriptor1",
"Characteristic",
)
}
fn value(&self) -> nonblock::MethodReply<Vec<u8>> {
<Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
&self,
"org.bluez.GattDescriptor1",
"Value",
)
}
}