pub struct HivePeer {
pub node_id: NodeId,
pub identifier: String,
pub mesh_id: Option<String>,
pub name: Option<String>,
pub rssi: i8,
pub is_connected: bool,
pub last_seen_ms: u64,
}Expand description
Unified peer representation across all platforms
Represents a discovered or connected HIVE mesh peer with all relevant metadata for mesh operations.
Fields§
§node_id: NodeIdHIVE node identifier (32-bit)
identifier: StringPlatform-specific BLE identifier
- iOS: CBPeripheral UUID string
- Android: MAC address string
- ESP32: MAC address or NimBLE handle
mesh_id: Option<String>Mesh ID this peer belongs to (e.g., “DEMO”)
name: Option<String>Advertised device name (e.g., “HIVE_DEMO-12345678”)
rssi: i8Last known signal strength (RSSI in dBm)
is_connected: boolWhether we have an active BLE connection to this peer
last_seen_ms: u64Timestamp when this peer was last seen (milliseconds since epoch/boot)
Implementations§
Source§impl HivePeer
impl HivePeer
Sourcepub fn new(
node_id: NodeId,
identifier: String,
mesh_id: Option<String>,
name: Option<String>,
rssi: i8,
) -> Self
pub fn new( node_id: NodeId, identifier: String, mesh_id: Option<String>, name: Option<String>, rssi: i8, ) -> Self
Create a new peer from discovery data
Sourcepub fn is_stale(&self, now_ms: u64, timeout_ms: u64) -> bool
pub fn is_stale(&self, now_ms: u64, timeout_ms: u64) -> bool
Check if this peer is stale (not seen within timeout)
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Get display name for this peer
Sourcepub fn signal_strength(&self) -> SignalStrength
pub fn signal_strength(&self) -> SignalStrength
Get signal strength category
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HivePeer
impl RefUnwindSafe for HivePeer
impl Send for HivePeer
impl Sync for HivePeer
impl Unpin for HivePeer
impl UnwindSafe for HivePeer
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