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
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.
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.
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.
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.
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.
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.
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
pub fn from_header_and_payload(
header: Header,
payload: &mut ByteReader<'a>
) -> Result<Self, Error>
pub fn from_header_and_payload(
header: Header,
payload: &mut ByteReader<'a>
) -> Result<Self, Error>
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 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
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
impl<'a> RefUnwindSafe for Pdu<'a>
impl<'a> UnwindSafe for Pdu<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more