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: UuidService UUID
Implementations§
Source§impl HiveGattService
impl HiveGattService
Sourcepub fn new(
node_id: NodeId,
hierarchy_level: HierarchyLevel,
capabilities: u16,
) -> Self
pub fn new( node_id: NodeId, hierarchy_level: HierarchyLevel, capabilities: u16, ) -> Self
Create a new HIVE GATT service
Sourcepub fn set_event_callback(&mut self, callback: GattEventCallback)
pub fn set_event_callback(&mut self, callback: GattEventCallback)
Set event callback
Sourcepub fn service_uuid(&self) -> Uuid
pub fn service_uuid(&self) -> Uuid
Get service UUID
Sourcepub fn characteristics(&self) -> Vec<CharacteristicDescriptor>
pub fn characteristics(&self) -> Vec<CharacteristicDescriptor>
Get all characteristic descriptors
Sourcepub fn read_node_info(&self) -> Vec<u8> ⓘ
pub fn read_node_info(&self) -> Vec<u8> ⓘ
Handle Node Info read request
Sourcepub fn read_sync_state(&self) -> Vec<u8> ⓘ
pub fn read_sync_state(&self) -> Vec<u8> ⓘ
Handle Sync State read request
Sourcepub fn read_status(&self) -> Vec<u8> ⓘ
pub fn read_status(&self) -> Vec<u8> ⓘ
Handle Status read request
Sourcepub fn write_sync_data(&self, data: &[u8]) -> Result<Option<Vec<u8>>>
pub fn write_sync_data(&self, data: &[u8]) -> Result<Option<Vec<u8>>>
Handle Sync Data write request
Sourcepub fn write_command(&self, data: &[u8]) -> Result<()>
pub fn write_command(&self, data: &[u8]) -> Result<()>
Handle Command write request
Sourcepub fn update_battery(&self, percent: u8)
pub fn update_battery(&self, percent: u8)
Update battery percentage
Sourcepub fn update_hierarchy_level(&self, level: HierarchyLevel)
pub fn update_hierarchy_level(&self, level: HierarchyLevel)
Update hierarchy level
Sourcepub fn update_sync_progress(&self, progress: u8, pending_docs: u16)
pub fn update_sync_progress(&self, progress: u8, pending_docs: u16)
Update sync progress
Sourcepub fn update_parent_status(&self, connected: bool, rssi: Option<i8>)
pub fn update_parent_status(&self, connected: bool, rssi: Option<i8>)
Update parent connection status
Sourcepub fn update_child_count(&self, count: u8)
pub fn update_child_count(&self, count: u8)
Update child count
Sourcepub fn update_uptime(&self, minutes: u16)
pub fn update_uptime(&self, minutes: u16)
Update uptime
Sourcepub fn on_client_connected(&self, address: String)
pub fn on_client_connected(&self, address: String)
Handle client connection
Sourcepub fn on_client_disconnected(&self, address: &str)
pub fn on_client_disconnected(&self, address: &str)
Handle client disconnection
Sourcepub fn on_subscribe(&self, address: String, characteristic: &str)
pub fn on_subscribe(&self, address: String, characteristic: &str)
Handle notification subscription
Sourcepub fn on_mtu_changed(&self, mtu: u16)
pub fn on_mtu_changed(&self, mtu: u16)
Handle MTU change
Sourcepub fn connected_client_count(&self) -> usize
pub fn connected_client_count(&self) -> usize
Get connected client count
Sourcepub fn sync_state_subscribers(&self) -> Vec<String>
pub fn sync_state_subscribers(&self) -> Vec<String>
Get list of addresses subscribed to sync state
Sourcepub fn status_subscribers(&self) -> Vec<String>
pub fn status_subscribers(&self) -> Vec<String>
Get list of addresses subscribed to status
Auto Trait Implementations§
impl Freeze for HiveGattService
impl !RefUnwindSafe for HiveGattService
impl Send for HiveGattService
impl Sync for HiveGattService
impl Unpin for HiveGattService
impl !UnwindSafe for HiveGattService
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