pub struct GattClientFacade { /* private fields */ }
Expand description
Perform Gatt Client operations.
Note this object is shared among all threads created by server.
Implementations§
Source§impl GattClientFacade
impl GattClientFacade
pub fn new() -> GattClientFacade
pub async fn stop_scan(&self) -> Result<(), Error>
pub async fn start_scan(&self, filter: Option<Filter>) -> Result<(), Error>
pub async fn gattc_connect_to_service( &self, peer_id: String, service_id: u64, ) -> Result<(), Error>
pub async fn gattc_discover_characteristics( &self, ) -> Result<Vec<Characteristic>, Error>
pub async fn gattc_write_char_by_id( &self, id: u64, write_value: Vec<u8>, ) -> Result<(), Error>
pub async fn gattc_write_long_char_by_id( &self, id: u64, offset: u16, write_value: Vec<u8>, reliable_mode: bool, ) -> Result<(), Error>
pub async fn gattc_write_char_by_id_without_response( &self, id: u64, write_value: Vec<u8>, ) -> Result<(), Error>
pub async fn gattc_read_char_by_id(&self, id: u64) -> Result<Vec<u8>, Error>
pub async fn gattc_read_long_char_by_id( &self, id: u64, offset: u16, max_bytes: u16, ) -> Result<Vec<u8>, Error>
pub async fn gattc_read_char_by_type( &self, raw_uuid: String, ) -> Result<Vec<SerializableReadByTypeResult>, Error>
pub async fn gattc_read_desc_by_id(&self, id: u64) -> Result<Vec<u8>, Error>
pub async fn gattc_read_long_desc_by_id( &self, id: u64, offset: u16, max_bytes: u16, ) -> Result<Vec<u8>, Error>
pub async fn gattc_write_desc_by_id( &self, id: u64, write_value: Vec<u8>, ) -> Result<(), Error>
pub async fn gattc_write_long_desc_by_id( &self, id: u64, offset: u16, write_value: Vec<u8>, ) -> Result<(), Error>
pub async fn gattc_toggle_notify_characteristic( &self, id: u64, enable: bool, ) -> Result<(), Error>
pub async fn list_services(&self, id: String) -> Result<Vec<ServiceInfo>, Error>
pub fn get_client_proxy(&self, id: PeerId) -> Option<ClientProxy>
pub fn set_central_proxy(inner: Arc<RwLock<InnerGattClientFacade>>)
pub async fn connect_peripheral(&self, id: String) -> Result<(), Error>
pub async fn disconnect_peripheral(&self, id: String) -> Result<(), Error>
pub fn get_central_proxy(&self) -> Option<CentralProxy>
pub fn get_scan_responses(&self) -> Vec<BleScanResponse>
pub fn print(&self)
pub fn cleanup(&self)
Trait Implementations§
Source§impl Debug for GattClientFacade
impl Debug for GattClientFacade
Source§impl Facade for GattClientFacade
impl Facade for GattClientFacade
Source§fn handle_request<'life0, 'async_trait>(
&'life0 self,
method: String,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_request<'life0, 'async_trait>(
&'life0 self,
method: String,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously handle the incoming request for the given method and arguments, returning a
future object representing the pending operation.
Auto Trait Implementations§
impl Freeze for GattClientFacade
impl !RefUnwindSafe for GattClientFacade
impl Send for GattClientFacade
impl Sync for GattClientFacade
impl Unpin for GattClientFacade
impl !UnwindSafe for GattClientFacade
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OptionalField for Twhere
T: ?Sized,
impl<T> OptionalField for Twhere
T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.