Skip to main content

GattcEvent

Enum GattcEvent 

Source
pub enum GattcEvent<'a> {
    Service {
        conn_handle: ConnHandle,
        status: u16,
        service: Option<GattcService>,
    },
    Characteristic {
        conn_handle: ConnHandle,
        status: u16,
        chr: Option<GattcChr>,
    },
    ReadComplete {
        conn_handle: ConnHandle,
        status: u16,
        attr_handle: AttrHandle,
        data: Mbuf<'a>,
    },
    WriteComplete {
        conn_handle: ConnHandle,
        status: u16,
        attr_handle: AttrHandle,
    },
    Notify {
        conn_handle: ConnHandle,
        attr_handle: AttrHandle,
        indication: bool,
        data: Mbuf<'a>,
    },
}
Expand description

A GATT-client event, delivered on the host task to the single gattc_subscribe hook.

The discovery variants fire once per discovered item and then once more with a None payload to signal completion. status is the raw ATT/BLE_HS_* status (0 on success).

Variants§

§

Service

A service discovered by discover_services.

Fields

§conn_handle: ConnHandle
§status: u16
§service: Option<GattcService>
§

Characteristic

A characteristic discovered by discover_characteristics.

Fields

§conn_handle: ConnHandle
§status: u16
§chr: Option<GattcChr>
§

ReadComplete

Completion of a read. On success data holds the value; check status before reading it.

Fields

§conn_handle: ConnHandle
§status: u16
§attr_handle: AttrHandle
§data: Mbuf<'a>
§

WriteComplete

Completion of a write.

Fields

§conn_handle: ConnHandle
§status: u16
§attr_handle: AttrHandle
§

Notify

A notification or indication pushed by the peer (after subscribing by writing its CCCD).

Fields

§conn_handle: ConnHandle
§attr_handle: AttrHandle
§indication: bool
§data: Mbuf<'a>

Auto Trait Implementations§

§

impl<'a> !Send for GattcEvent<'a>

§

impl<'a> !Sync for GattcEvent<'a>

§

impl<'a> !UnwindSafe for GattcEvent<'a>

§

impl<'a> Freeze for GattcEvent<'a>

§

impl<'a> RefUnwindSafe for GattcEvent<'a>

§

impl<'a> Unpin for GattcEvent<'a>

§

impl<'a> UnsafeUnpin for GattcEvent<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.