nrf-softdevice

Crates

git

Versions

s112

Flavors

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§

source

fn uuid() -> Uuid

Get the UUID of the GATT service. This is used by discover to search for the service in the GATT server.

source

fn new_undiscovered(conn: Connection) -> Self

Create a new instance in a “not-yet-discovered” state.

source

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.

source

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

Implementors§