pub struct ParsedAdvertisement {
pub address: String,
pub rssi: i8,
pub beacon: Option<HiveBeacon>,
pub local_name: Option<String>,
pub tx_power: Option<i8>,
pub connectable: bool,
}Expand description
Parsed advertising data from a discovered device
Fields§
§address: StringDevice address (MAC or platform-specific)
rssi: i8RSSI in dBm
beacon: Option<HiveBeacon>Parsed HIVE beacon (if this is a HIVE device)
local_name: Option<String>Device local name
tx_power: Option<i8>TX power level (if advertised)
connectable: boolWhether the device is connectable
Implementations§
Source§impl ParsedAdvertisement
impl ParsedAdvertisement
Sourcepub fn is_hive_device(&self) -> bool
pub fn is_hive_device(&self) -> bool
Check if this is a HIVE device
Sourcepub fn estimated_distance_meters(&self) -> Option<f32>
pub fn estimated_distance_meters(&self) -> Option<f32>
Estimate distance based on RSSI and TX power
Uses the log-distance path loss model: distance = 10 ^ ((tx_power - rssi) / (10 * n)) where n is the path loss exponent (typically 2-4)
Note: Requires std feature for floating point math.
Trait Implementations§
Source§impl Clone for ParsedAdvertisement
impl Clone for ParsedAdvertisement
Source§fn clone(&self) -> ParsedAdvertisement
fn clone(&self) -> ParsedAdvertisement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedAdvertisement
impl RefUnwindSafe for ParsedAdvertisement
impl Send for ParsedAdvertisement
impl Sync for ParsedAdvertisement
impl Unpin for ParsedAdvertisement
impl UnwindSafe for ParsedAdvertisement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more