pub struct Lighthouse {
pub name: String,
pub address: String,
pub id: Option<String>,
pub managed: bool,
}Expand description
A discovered or known Lighthouse base station.
Fields§
§name: StringFriendly name of the device (e.g. “HTC BS-AABBCCDD” or “LHB-0A1B2C3D”).
address: StringBluetooth MAC address in colon-separated hex format: “AA:BB:CC:DD:EE:FF”.
id: Option<String>8-char hex ID printed on the back of V1 lighthouses (e.g. “AABBCCDD”). Only present for V1 devices and required for power control.
managed: boolWhether this lighthouse should be controlled by this manager. Newly discovered lighthouses are unmanaged by default.
Implementations§
Source§impl Lighthouse
impl Lighthouse
Sourcepub fn version(&self) -> LighthouseVersion
pub fn version(&self) -> LighthouseVersion
Determine the version of a lighthouse from its name.
- Starts with “HTC BS” → V1
- Starts with “LHB-” → V2
Sourcepub fn power_characteristic(&self) -> &'static str
pub fn power_characteristic(&self) -> &'static str
Returns the GATT characteristic UUID for power-on/sleep commands.
Sourcepub fn identify_characteristic(&self) -> Option<&'static str>
pub fn identify_characteristic(&self) -> Option<&'static str>
Returns the GATT characteristic UUID for identify commands (V2 only).
Trait Implementations§
Source§impl Clone for Lighthouse
impl Clone for Lighthouse
Source§fn clone(&self) -> Lighthouse
fn clone(&self) -> Lighthouse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Lighthouse
impl Debug for Lighthouse
Source§impl<'de> Deserialize<'de> for Lighthouse
impl<'de> Deserialize<'de> for Lighthouse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Lighthouse
impl PartialEq for Lighthouse
Source§fn eq(&self, other: &Lighthouse) -> bool
fn eq(&self, other: &Lighthouse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Lighthouse
impl Serialize for Lighthouse
impl Eq for Lighthouse
impl StructuralPartialEq for Lighthouse
Auto Trait Implementations§
impl Freeze for Lighthouse
impl RefUnwindSafe for Lighthouse
impl Send for Lighthouse
impl Sync for Lighthouse
impl Unpin for Lighthouse
impl UnsafeUnpin for Lighthouse
impl UnwindSafe for Lighthouse
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