Trait nrf_softdevice::ble::gatt_client::Client
source · pub trait Client {
// Required methods
fn uuid() -> Uuid;
fn new_undiscovered(conn: Connection) -> Self;
fn discovered_characteristic(
&mut self,
characteristic: &Characteristic,
descriptors: &[Descriptor]
);
fn discovery_complete(&mut self) -> Result<(), DiscoverError>;
}
Expand description
Trait for implementing GATT clients.
Required Methods§
sourcefn uuid() -> Uuid
fn uuid() -> Uuid
Get the UUID of the GATT service. This is used by discover
to search for the
service in the GATT server.
sourcefn new_undiscovered(conn: Connection) -> Self
fn new_undiscovered(conn: Connection) -> Self
Create a new instance in a “not-yet-discovered” state.
sourcefn discovered_characteristic(
&mut self,
characteristic: &Characteristic,
descriptors: &[Descriptor]
)
fn discovered_characteristic(
&mut self,
characteristic: &Characteristic,
descriptors: &[Descriptor]
)
Called by discover
for every discovered characteristic. Implementations must
check if they’re interested in the UUID of the characteristic, and save their
handles if needed.
sourcefn discovery_complete(&mut self) -> Result<(), DiscoverError>
fn discovery_complete(&mut self) -> Result<(), DiscoverError>
Called by discover
at the end of the discovery procedure. Implementations must check
that all required characteristics have been discovered, and return DiscoverError::ServiceIncomplete
otherwise.
If no error is returned, this instance is considered ready to use and is returned to
the caller of discover