Enum rubble::link::ad_structure::AdStructure [−][src]
#[non_exhaustive]
pub enum AdStructure<'a> {
Flags(Flags),
ServiceUuids16(ServiceUuids<'a, Uuid16>),
ServiceUuids32(ServiceUuids<'a, Uuid32>),
ServiceUuids128(ServiceUuids<'a, Uuid128>),
ServiceData16 {
uuid: u16,
data: &'a [u8],
},
CompleteLocalName(&'a str),
ShortenedLocalName(&'a str),
ManufacturerSpecificData {
company_identifier: CompanyId,
payload: &'a [u8],
},
Unknown {
ty: u8,
data: &'a [u8],
},
}
Expand description
A list of AD structures can be sent along with an advertising packet or scan response.
This mechanism allows a scanner to, for example, receive the device’s name without having to establish a connection.
Unless otherwise noted, each variant of this enum should only be included at most once per packet sent.
From a very unrepresentative scan, most devices seem to include Flags and Manufacturer Data, and optionally a device name, of course.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Flags(Flags)
Device flags and baseband capabilities.
This should be sent if any flags apply to the device. If not (ie. the value sent would be 0), this may be omitted.
Must not be used in scan response data.
Tuple Fields of Flags
0: Flags
ServiceUuids16(ServiceUuids<'a, Uuid16>)
Tuple Fields of ServiceUuids16
0: ServiceUuids<'a, Uuid16>
ServiceUuids32(ServiceUuids<'a, Uuid32>)
Tuple Fields of ServiceUuids32
0: ServiceUuids<'a, Uuid32>
ServiceUuids128(ServiceUuids<'a, Uuid128>)
Tuple Fields of ServiceUuids128
0: ServiceUuids<'a, Uuid128>
Service data with 16-bit service UUID.
Fields of ServiceData16
CompleteLocalName(&'a str)
Sets the full (unabbreviated) device name.
This will be shown to the user when this device is found.
Tuple Fields of CompleteLocalName
0: &'a str
ShortenedLocalName(&'a str)
Sets the shortened device name.
Tuple Fields of ShortenedLocalName
0: &'a str
Set manufacturer specific data
An unknown or unimplemented AD structure stored as raw bytes.
Trait Implementations
Decode a Self
from a byte slice, advancing bytes
to point past the data that was read. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for AdStructure<'a>
impl<'a> Send for AdStructure<'a>
impl<'a> Sync for AdStructure<'a>
impl<'a> Unpin for AdStructure<'a>
impl<'a> UnwindSafe for AdStructure<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more