[][src]Enum rubble::link::advertising::Pdu

pub enum Pdu<'a> {
    ConnectableUndirected {
        advertiser_addr: DeviceAddress,
        advertising_data: BytesOr<'a, [AdStructure<'a>]>,
    },
    ConnectableDirected {
        advertiser_addr: DeviceAddress,
        initiator_addr: DeviceAddress,
    },
    NonconnectableUndirected {
        advertiser_addr: DeviceAddress,
        advertising_data: BytesOr<'a, [AdStructure<'a>]>,
    },
    ScannableUndirected {
        advertiser_addr: DeviceAddress,
        advertising_data: BytesOr<'a, [AdStructure<'a>]>,
    },
    ScanRequest {
        scanner_addr: DeviceAddress,
        advertiser_addr: DeviceAddress,
    },
    ScanResponse {
        advertiser_addr: DeviceAddress,
        scan_data: BytesOr<'a, [AdStructure<'a>]>,
    },
    ConnectRequest {
        initiator_addr: DeviceAddress,
        advertiser_addr: DeviceAddress,
        lldata: ConnectRequestData,
    },
}

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]

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.

impl<'a> Debug for Pdu<'a>[src]

impl<'a> Copy for Pdu<'a>[src]

impl<'a> Clone for Pdu<'a>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'a> Send for Pdu<'a>

impl<'a> Sync for Pdu<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]