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

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,
    },
}
Expand description

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.

Implementations

Constructs a PDU by parsing payload.

Returns the device address of the sender of this PDU.

Returns the intended receiver of this PDU.

This may be None if the PDU doesn’t have a fixed receiver.

Returns the PDU type of self.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Decodes an advertising channel PDU (consisting of header and payload) from raw bytes.

Decode a Self from a byte slice, advancing bytes to point past the data that was read. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.