[−][src]Enum rubble::link::advertising::Pdu
A parsed advertising channel PDU.
Variants
ConnectableUndirected
Connectable and scannable advertisement.
Fields of ConnectableUndirected
advertiser_addr: DeviceAddress
Address of the advertising device that is sending this PDU.
advertising_data: BytesOr<'a, [AdStructure<'a>]>
AD structures sent along with the advertisement.
ConnectableDirected
Directed connectable advertisement sent to an initiator.
Does not contain advertisement data.
Fields of ConnectableDirected
advertiser_addr: DeviceAddress
Address of the advertising device that is sending this PDU.
initiator_addr: DeviceAddress
Intended receiver of the advertisement.
NonconnectableUndirected
A non-connectable undirected advertisement (aka "beacon").
Fields of NonconnectableUndirected
advertiser_addr: DeviceAddress
Address of the advertising device (beacon) that is sending this PDU.
advertising_data: BytesOr<'a, [AdStructure<'a>]>
AD structures sent along with the advertisement.
ScannableUndirected
Scannable advertisement.
Fields of ScannableUndirected
advertiser_addr: DeviceAddress
Address of the advertising device that is sending this PDU.
advertising_data: BytesOr<'a, [AdStructure<'a>]>
AD structures sent along with the advertisement.
ScanRequest
Scan request sent from a scanner to an advertising device.
This can only be sent in response to an advertising PDU that indicates
that the advertising device is scannable (ConnectableUndirected
and
ScannableUndirected
).
Fields of ScanRequest
scanner_addr: DeviceAddress
Address of the scanning device sending this PDU.
advertiser_addr: DeviceAddress
Address of the advertising device that should be scanned.
ScanResponse
Response to a scan request, sent by the scanned advertising device.
Fields of ScanResponse
advertiser_addr: DeviceAddress
Address of the advertising device that responds to a scan request by sending this PDU.
scan_data: BytesOr<'a, [AdStructure<'a>]>
Scan data payload, consisting of additional user-defined AD structures.
ConnectRequest
A request to establish a connection, sent by an initiating device.
This may only be sent to an advertising device that has broadcast a
connectable advertisement (ConnectableUndirected
or
ConnectableDirected
).
Fields of ConnectRequest
initiator_addr: DeviceAddress
Address of the device initiating the connection by sending this PDU.
advertiser_addr: DeviceAddress
Address of the intended receiver of this packet.
lldata: ConnectRequestData
Connection parameters.
Methods
impl<'a> Pdu<'a>
[src]
pub fn from_header_and_payload(
header: Header,
payload: &mut ByteReader<'a>
) -> Result<Self, Error>
[src]
header: Header,
payload: &mut ByteReader<'a>
) -> Result<Self, Error>
Constructs a PDU by parsing payload
.
pub fn sender(&self) -> &DeviceAddress
[src]
Returns the device address of the sender of this PDU.
pub fn receiver(&self) -> Option<&DeviceAddress>
[src]
Returns the intended receiver of this PDU.
This may be None
if the PDU doesn't have a fixed receiver.
pub fn ty(&self) -> PduType
[src]
Returns the PDU type of self
.
pub fn advertising_data(&self) -> Option<impl Iterator<Item = AdStructure<'a>>>
[src]
Returns an iterator over all AD structures encoded in the PDU.
If this PDU doesn't support attaching AD structures, this will return
None
.
Trait Implementations
impl<'a> FromBytes<'a> for Pdu<'a>
[src]
Decodes an advertising channel PDU (consisting of header and payload) from raw bytes.
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> Debug for Pdu<'a>
[src]
impl<'a> Copy for Pdu<'a>
[src]
impl<'a> Clone for Pdu<'a>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,