Struct esp32_nimble::BLECharacteristic
source · 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
pub fn value_mut(&mut self) -> &mut AttValue
pub fn on_read( &mut self, callback: impl FnMut(&mut AttValue, &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 create_2904_descriptor(&mut self) -> BLE2904
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::NimbleSub
for event type