Enum Event

Source
pub enum Event {
Show 21 variants ConnectionComplete(ConnectionComplete), DisconnectionComplete(DisconnectionComplete), EncryptionChange(EncryptionChange), ReadRemoteVersionInformationComplete(RemoteVersionInformation), CommandComplete(CommandComplete), CommandStatus(CommandStatus), HardwareError(HardwareError), NumberOfCompletedPackets(NumberOfCompletedPackets), DataBufferOverflow(DataBufferOverflow), EncryptionKeyRefreshComplete(EncryptionKeyRefreshComplete), LeConnectionComplete(LeConnectionComplete), LeAdvertisingReport(LeAdvertisingReport), LeConnectionUpdateComplete(LeConnectionUpdateComplete), LeReadRemoteUsedFeaturesComplete(LeReadRemoteUsedFeaturesComplete), LeLongTermKeyRequest(LeLongTermKeyRequest), LeDataLengthChangeEvent(LeDataLengthChangeEvent), LeReadLocalP256PublicKeyComplete([u8; 64]), LeGenerateDHKeyComplete([u8; 32]), LeEnhancedConnectionComplete(LeEnhancedConnectionComplete), LePhyUpdateComplete(LePhyUpdateComplete), Vendor(VendorEvent),
}
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)

Vol 2, Part E, Section 7.7.3

§

DisconnectionComplete(DisconnectionComplete)

Vol 2, Part E, Section 7.7.5

§

EncryptionChange(EncryptionChange)

Vol 2, Part E, Section 7.7.8

§

ReadRemoteVersionInformationComplete(RemoteVersionInformation)

Vol 2, Part E, Section 7.7.12

§

CommandComplete(CommandComplete)

Vol 2, Part E, Section 7.7.14

§

CommandStatus(CommandStatus)

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)

Vol 2, Part E, Section 7.7.39

§

LeConnectionComplete(LeConnectionComplete)

Vol 2, Part E, Section 7.7.65.1

§

LeAdvertisingReport(LeAdvertisingReport)

Vol 2, Part E, Section 7.7.65.2

§

LeConnectionUpdateComplete(LeConnectionUpdateComplete)

Vol 2, Part E, Section 7.7.65.3

§

LeReadRemoteUsedFeaturesComplete(LeReadRemoteUsedFeaturesComplete)

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

§

LeReadLocalP256PublicKeyComplete([u8; 64])

This event is generated when local P-256 key generation is complete.

Vol 4, Part E, 7.7.65.8

§

LeGenerateDHKeyComplete([u8; 32])

This event indicates that LE Diffie Hellman key generation has been completed by the Controller.

Vol 4, Part E, Section 7.7.65.9

§

LeEnhancedConnectionComplete(LeEnhancedConnectionComplete)

Vol 4, Part E, Section 7.7.65.10

§

LePhyUpdateComplete(LePhyUpdateComplete)

Vol 2, Part E, Section 7.7.65.12

§

Vendor(VendorEvent)

Vendor-specific events (opcode 0xFF)

Implementations§

Source§

impl Event

Source

pub fn new(packet: Packet<'_>) -> Result<Event, 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 Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate 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 Debug for Event

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.