pub struct BLECharacteristic { /* private fields */ }Implementations§
Source§impl BLECharacteristic
impl BLECharacteristic
pub fn uuid(&self) -> BleUuid
pub fn set_value(&mut self, value: &[u8]) -> &mut Self
pub fn set_from<T: Sized>(&mut self, value: &T) -> &mut Self
👎Deprecated:
Please use set_value + zerocopy::IntoBytes
pub fn value_mut(&mut self) -> &mut AttValue
pub fn on_read( &mut self, callback: impl FnMut(&mut Self, &BLEConnDesc) + Send + Sync + 'static, ) -> &mut Self
Sourcepub fn on_write(
&mut self,
callback: impl FnMut(&mut OnWriteArgs<'_>) + Send + Sync + 'static,
) -> &mut Self
pub fn on_write( &mut self, callback: impl FnMut(&mut OnWriteArgs<'_>) + Send + Sync + 'static, ) -> &mut Self
This characteristic is locked while the callback is executing. If you call .lock() on this characteristic from inside the callback, it will never execute.
pub fn on_notify_tx( &mut self, callback: impl FnMut(NotifyTx<'_>) + Send + Sync + 'static, ) -> &mut Self
pub fn create_descriptor( &mut self, uuid: BleUuid, properties: DescriptorProperties, ) -> Arc<Mutex<BLEDescriptor>>
pub fn notify_with( &self, value: &[u8], conn_handle: u16, ) -> Result<(), BLEError>
pub fn notify(&self)
Sourcepub fn on_subscribe(
&mut self,
callback: impl FnMut(&Self, &BLEConnDesc, NimbleSub) + Send + Sync + 'static,
) -> &mut Self
pub fn on_subscribe( &mut self, callback: impl FnMut(&Self, &BLEConnDesc, NimbleSub) + Send + Sync + 'static, ) -> &mut Self
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 seecrate::NimbleSubfor event type
pub fn subscribed_count(&self) -> usize
Trait Implementations§
Source§impl Debug for BLECharacteristic
impl Debug for BLECharacteristic
impl Send for BLECharacteristic
Auto Trait Implementations§
impl Freeze for BLECharacteristic
impl !RefUnwindSafe for BLECharacteristic
impl !Sync for BLECharacteristic
impl Unpin for BLECharacteristic
impl UnsafeUnpin for BLECharacteristic
impl !UnwindSafe for BLECharacteristic
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more