Enum stm32wb_hci::event::Event

source ·
pub enum Event<V>where
    V: VendorEvent,{
Show 18 variants ConnectionComplete(ConnectionComplete<V::Status>), DisconnectionComplete(DisconnectionComplete<V::Status>), EncryptionChange(EncryptionChange<V::Status>), ReadRemoteVersionInformationComplete(RemoteVersionInformation<V::Status>), CommandComplete(CommandComplete<V>), CommandStatus(CommandStatus<V::Status>), HardwareError(HardwareError), NumberOfCompletedPackets(NumberOfCompletedPackets), DataBufferOverflow(DataBufferOverflow), EncryptionKeyRefreshComplete(EncryptionKeyRefreshComplete<V::Status>), LeConnectionComplete(LeConnectionComplete<V::Status>), LeAdvertisingReport(LeAdvertisingReport), LeConnectionUpdateComplete(LeConnectionUpdateComplete<V::Status>), LeReadRemoteUsedFeaturesComplete(LeReadRemoteUsedFeaturesComplete<V::Status>), LeLongTermKeyRequest(LeLongTermKeyRequest), LeDataLengthChangeEvent(LeDataLengthChangeEvent), LePhyUpdateComplete(LePhyUpdateComplete<V::Status>), Vendor(V),
}
Expand description

Potential events that can be generated by the controller.

See the Bluetooth Spec v4.1, Vol 2, Part E, Section 7.7 for a description of each event. The events are the same for versions 4.1, 4.2, and 5.0 except where noted.

The spec defines an “LE Meta-Event” event. This event is not exposed directly. Instead, individual LE events are included in this enum.

Variants§

§

ConnectionComplete(ConnectionComplete<V::Status>)

Vol 2, Part E, Section 7.7.3

§

DisconnectionComplete(DisconnectionComplete<V::Status>)

Vol 2, Part E, Section 7.7.5

§

EncryptionChange(EncryptionChange<V::Status>)

Vol 2, Part E, Section 7.7.8

§

ReadRemoteVersionInformationComplete(RemoteVersionInformation<V::Status>)

Vol 2, Part E, Section 7.7.12

§

CommandComplete(CommandComplete<V>)

Vol 2, Part E, Section 7.7.14

§

CommandStatus(CommandStatus<V::Status>)

Vol 2, Part E, Section 7.7.15

§

HardwareError(HardwareError)

Vol 2, Part E, Section 7.7.16

§

NumberOfCompletedPackets(NumberOfCompletedPackets)

Vol 2, Part E, Section 7.7.19

§

DataBufferOverflow(DataBufferOverflow)

Vol 2, Part E, Section 7.7.26

§

EncryptionKeyRefreshComplete(EncryptionKeyRefreshComplete<V::Status>)

Vol 2, Part E, Section 7.7.39

§

LeConnectionComplete(LeConnectionComplete<V::Status>)

Vol 2, Part E, Section 7.7.65.1

§

LeAdvertisingReport(LeAdvertisingReport)

Vol 2, Part E, Section 7.7.65.2

§

LeConnectionUpdateComplete(LeConnectionUpdateComplete<V::Status>)

Vol 2, Part E, Section 7.7.65.3

§

LeReadRemoteUsedFeaturesComplete(LeReadRemoteUsedFeaturesComplete<V::Status>)

Vol 2, Part E, Section 7.7.65.4

§

LeLongTermKeyRequest(LeLongTermKeyRequest)

Vol 2, Part E, Section 7.7.65.5

§

LeDataLengthChangeEvent(LeDataLengthChangeEvent)

Vol 2, Part E, Section 7.7.65.7

§

LePhyUpdateComplete(LePhyUpdateComplete<V::Status>)

Vol 2, Part E, Section 7.7.65.12

§

Vendor(V)

Vendor-specific events (opcode 0xFF)

Implementations§

source§

impl<V> Event<V>where V: VendorEvent,

source

pub fn new(packet: Packet<'_>) -> Result<Event<V>, Error<V::Error>>

Deserializes an event from the given packet. The packet should contain all of the data needed to deserialize the event.

Errors
  • UnknownEvent error if the first byte of the header is not a recognized event type. This includes events that may be valid BLE events, but are not yet be implemented by this crate.
  • BadLength error if the length of the packet is not sufficient to either (1) contain a packet header, or (2) contain the packet data as defined by the header.
  • Other errors if the particular event cannot be correctly deserialized from the packet. This includes vendor-specific errors for vendor events.

Trait Implementations§

source§

impl<V> Clone for Event<V>where V: VendorEvent + Clone, V::Status: Clone,

source§

fn clone(&self) -> Event<V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<V> Debug for Event<V>where V: VendorEvent + Debug, V::Status: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.