Skip to content

Commit c0e60a5

Browse files
szymonlesiszqdot
authored andcommitted
feat: add advertisement_name to PeripheralProperties
1 parent 6e5120e commit c0e60a5

5 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/api/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ pub struct PeripheralProperties {
181181
pub address: BDAddr,
182182
/// The type of address (either random or public)
183183
pub address_type: Option<AddressType>,
184-
/// The local name. This is generally a human-readable string that identifies the type of device.
184+
/// The GAP local name. This is generally a human-readable string that identifies the type of device.
185185
pub local_name: Option<String>,
186+
/// The advertisement name. May be different than local_name.
187+
pub advertisement_name: Option<String>,
186188
/// The transmission power level for the device
187189
pub tx_power_level: Option<i16>,
188190
/// The most recent Received Signal Strength Indicator for the device

src/bluez/peripheral.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ impl api::Peripheral for Peripheral {
144144
address: device_info.mac_address.into(),
145145
address_type: Some(device_info.address_type.into()),
146146
local_name: device_info.name,
147+
advertisement_name: None,
147148
tx_power_level: device_info.tx_power,
148149
rssi: device_info.rssi,
149150
manufacturer_data: device_info.manufacturer_data,

src/corebluetooth/peripheral.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl Peripheral {
9494
address: BDAddr::default(),
9595
address_type: None,
9696
local_name,
97+
advertisement_name: None,
9798
tx_power_level: None,
9899
rssi: None,
99100
manufacturer_data: HashMap::new(),

src/droidplug/jni/objects.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ impl<'a: 'b, 'b> TryFrom<JScanResult<'a, 'b>> for (BDAddr, Option<PeripheralProp
733733
address: addr,
734734
address_type: None,
735735
local_name: device_name,
736+
advertisement_name: None,
736737
tx_power_level,
737738
manufacturer_data,
738739
service_data,

src/winrtble/peripheral.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ impl Peripheral {
117117
address: self.address(),
118118
address_type: *self.shared.address_type.read().unwrap(),
119119
local_name: self.shared.local_name.read().unwrap().clone(),
120+
advertisement_name: None,
120121
tx_power_level: *self.shared.last_tx_power_level.read().unwrap(),
121122
rssi: *self.shared.last_rssi.read().unwrap(),
122123
manufacturer_data: self.shared.latest_manufacturer_data.read().unwrap().clone(),

0 commit comments

Comments
 (0)