pub enum Event {
Show 21 variants
Discovered {
address: String,
name: Option<String>,
rssi: i32,
service_uuids: Vec<String>,
manufacturer_data: Vec<(u16, Vec<u8>)>,
service_data: Vec<(String, Vec<u8>)>,
class_of_device: Option<u32>,
connectable: bool,
},
ScanFailed {
code: i32,
},
ConnectionStateChanged {
gatt: Ref,
status: i32,
connected: bool,
},
ServicesDiscovered {
gatt: Ref,
status: i32,
},
CharacteristicRead {
gatt: Ref,
characteristic: Ref,
value: Vec<u8>,
status: i32,
},
CharacteristicWritten {
gatt: Ref,
characteristic: Ref,
status: i32,
},
CharacteristicChanged {
gatt: Ref,
characteristic: Ref,
value: Vec<u8>,
},
DescriptorRead {
gatt: Ref,
descriptor: Ref,
value: Vec<u8>,
status: i32,
},
DescriptorWritten {
gatt: Ref,
descriptor: Ref,
status: i32,
},
PhyChanged {
gatt: Ref,
tx: i32,
rx: i32,
status: i32,
},
MtuChanged {
gatt: Ref,
mtu: i32,
status: i32,
},
RssiRead {
gatt: Ref,
rssi: i32,
status: i32,
},
ServicesChanged {
gatt: Ref,
},
ServerConnectionStateChanged {
device: Ref,
connected: bool,
},
ServiceAdded {
status: i32,
},
ReadRequest {
device: Ref,
request_id: i32,
offset: i32,
characteristic: Ref,
},
WriteRequest {
device: Ref,
request_id: i32,
characteristic: Ref,
prepared: bool,
response_needed: bool,
offset: i32,
value: Vec<u8>,
},
DescriptorReadRequest {
device: Ref,
request_id: i32,
offset: i32,
descriptor: Ref,
},
DescriptorWriteRequest {
device: Ref,
request_id: i32,
descriptor: Ref,
response_needed: bool,
offset: i32,
value: Vec<u8>,
},
NotificationSent {
device: Ref,
status: i32,
},
AdvertisingStarted {
error: Option<i32>,
},
}Expand description
What Android tells us.
Variants§
Discovered
A scan result. record is the raw advertising payload when Android
supplies one.
Fields
ScanFailed
ConnectionStateChanged
onConnectionStateChange. status is a GATT_* code; 0 is success.
ServicesDiscovered
CharacteristicRead
CharacteristicWritten
CharacteristicChanged
A subscription delivering a value.
DescriptorRead
DescriptorWritten
PhyChanged
The link’s PHY, as reported by onPhyUpdate or onPhyRead.
One event for both because they carry the same thing and a caller only ever has one outstanding: the difference is whether it was asked to change or merely to report.
MtuChanged
RssiRead
ServicesChanged
The peer’s attribute table changed; every handle into it is stale.
ServerConnectionStateChanged
ServiceAdded
ReadRequest
WriteRequest
Fields
DescriptorReadRequest
DescriptorWriteRequest
NotificationSent
AdvertisingStarted
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more