MCPcopy Create free account
hub / github.com/deviceplug/btleplug / derive_properties

Method derive_properties

src/winrtble/peripheral.rs:120–140  ·  view source on GitHub ↗

TODO: see if the other backends can also be similarly decoupled from PeripheralProperties so it can potentially be replaced by individial state getters

(&self)

Source from the content-addressed store, hash-verified

118 // TODO: see if the other backends can also be similarly decoupled from PeripheralProperties
119 // so it can potentially be replaced by individial state getters
120 fn derive_properties(&self) -> PeripheralProperties {
121 PeripheralProperties {
122 address: self.address(),
123 address_type: *self.shared.address_type.read().unwrap(),
124 local_name: self.shared.local_name.read().unwrap().clone(),
125 advertisement_name: self.shared.advertisement_name.read().unwrap().clone(),
126 tx_power_level: *self.shared.last_tx_power_level.read().unwrap(),
127 rssi: *self.shared.last_rssi.read().unwrap(),
128 manufacturer_data: self.shared.latest_manufacturer_data.read().unwrap().clone(),
129 service_data: self.shared.latest_service_data.read().unwrap().clone(),
130 services: self
131 .shared
132 .services
133 .read()
134 .unwrap()
135 .iter()
136 .copied()
137 .collect(),
138 class: *self.shared.class.read().unwrap(),
139 }
140 }
141
142 pub(crate) fn update_properties(&self, args: &BluetoothLEAdvertisementReceivedEventArgs) {
143 let advertisement = args.Advertisement().unwrap();

Callers 2

fmtMethod · 0.80
propertiesMethod · 0.80

Calls 3

iterMethod · 0.80
addressMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected