HiveGattService

Struct HiveGattService 

Source
pub struct HiveGattService {
    pub uuid: Uuid,
    /* private fields */
}
Expand description

HIVE GATT Service

Manages the GATT service lifecycle and provides handlers for characteristic operations.

Fields§

§uuid: Uuid

Service UUID

Implementations§

Source§

impl HiveGattService

Source

pub fn new( node_id: NodeId, hierarchy_level: HierarchyLevel, capabilities: u16, ) -> Self

Create a new HIVE GATT service

Source

pub fn set_event_callback(&mut self, callback: GattEventCallback)

Set event callback

Source

pub fn service_uuid(&self) -> Uuid

Get service UUID

Source

pub fn characteristics(&self) -> Vec<CharacteristicDescriptor>

Get all characteristic descriptors

Source

pub fn read_node_info(&self) -> Vec<u8>

Handle Node Info read request

Source

pub fn read_sync_state(&self) -> Vec<u8>

Handle Sync State read request

Source

pub fn read_status(&self) -> Vec<u8>

Handle Status read request

Source

pub fn write_sync_data(&self, data: &[u8]) -> Result<Option<Vec<u8>>>

Handle Sync Data write request

Source

pub fn write_command(&self, data: &[u8]) -> Result<()>

Handle Command write request

Source

pub fn update_battery(&self, percent: u8)

Update battery percentage

Source

pub fn update_hierarchy_level(&self, level: HierarchyLevel)

Update hierarchy level

Source

pub fn update_sync_progress(&self, progress: u8, pending_docs: u16)

Update sync progress

Source

pub fn update_parent_status(&self, connected: bool, rssi: Option<i8>)

Update parent connection status

Source

pub fn update_child_count(&self, count: u8)

Update child count

Source

pub fn update_uptime(&self, minutes: u16)

Update uptime

Source

pub fn on_client_connected(&self, address: String)

Handle client connection

Source

pub fn on_client_disconnected(&self, address: &str)

Handle client disconnection

Source

pub fn on_subscribe(&self, address: String, characteristic: &str)

Handle notification subscription

Source

pub fn on_mtu_changed(&self, mtu: u16)

Handle MTU change

Source

pub fn mtu(&self) -> u16

Get current MTU

Source

pub fn connected_client_count(&self) -> usize

Get connected client count

Source

pub fn sync_state_subscribers(&self) -> Vec<String>

Get list of addresses subscribed to sync state

Source

pub fn status_subscribers(&self) -> Vec<String>

Get list of addresses subscribed to status

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.