From 9b40b48e7c69d0ee9c725c5bcf79d5b6895b6a36 Mon Sep 17 00:00:00 2001 From: sampaioletti Date: Thu, 29 Feb 2024 16:57:08 -0700 Subject: [PATCH 1/2] mention unsub event --- src/server/ble_characteristic.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/ble_characteristic.rs b/src/server/ble_characteristic.rs index 1403c1c..84698f5 100644 --- a/src/server/ble_characteristic.rs +++ b/src/server/ble_characteristic.rs @@ -75,8 +75,11 @@ impl NotifyTx<'_> { bitflags! { #[repr(transparent)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] + ///Empty NimbleSub i.e. `NimbleSub::is_empty()==true` means Unsubscribe or No Subscription pub struct NimbleSub: u16 { + /// Subscribe if Notify const NOTIFY = 0x0001; + /// Subscribe if Indicate const INDICATE = 0x0002; } } @@ -365,6 +368,8 @@ impl BLECharacteristic { /// Do not call `lock` on this characteristic inside the callback, use the first input instead. /// In the future, this characteristic could be locked while the callback executes. + /// * `callback` - Function to call when a subscription event is recieved, including subscribe and unsubscribe events + /// see [`crate::NimbleSub`] for event type pub fn on_subscribe( &mut self, callback: impl FnMut(&Self, &BLEConnDesc, NimbleSub) + Send + Sync + 'static, From 9f618796f3d3dd373bd0294ea7f189f2a1a77564 Mon Sep 17 00:00:00 2001 From: sampaioletti Date: Thu, 29 Feb 2024 17:00:36 -0700 Subject: [PATCH 2/2] change wording --- src/server/ble_characteristic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/ble_characteristic.rs b/src/server/ble_characteristic.rs index 84698f5..c4faa44 100644 --- a/src/server/ble_characteristic.rs +++ b/src/server/ble_characteristic.rs @@ -75,7 +75,7 @@ impl NotifyTx<'_> { bitflags! { #[repr(transparent)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] - ///Empty NimbleSub i.e. `NimbleSub::is_empty()==true` means Unsubscribe or No Subscription + ///Empty NimbleSub i.e. `NimbleSub::is_empty()==true` means Unsubscribe(d) pub struct NimbleSub: u16 { /// Subscribe if Notify const NOTIFY = 0x0001;