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
impl Event
Sourcepub fn new(packet: Packet<'_>) -> Result<Event, Error>
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.