Struct rubble::link::advertising::PduBuf[][src]

pub struct PduBuf {
    header: Header,
    payload_buf: [u8; 37],
}
Expand description

Stores an advertising channel PDU.

This is an owned version of Pdu and should be used when creating a PDU to be sent out.

Fields

header: Header

2-Byte header.

payload_buf: [u8; 37]

Fixed-size buffer that can store the largest PDU. Actual length is stored in the header.

Implementations

Builds a PDU buffer containing advertiser address and data.

Creates a connectable undirected advertising PDU (ADV_IND).

Parameters

  • adv: The advertiser address, the address of the device sending this PDU.
  • adv_data: Additional advertising data to send.

Creates a connectable directed advertising PDU (ADV_DIRECT_IND).

Creates a non-connectable undirected advertising PDU (ADV_NONCONN_IND).

This is equivalent to PduBuf::beacon, which should be preferred when building a beacon PDU to improve clarity.

Creates a scannable undirected advertising PDU (ADV_SCAN_IND).

Note that scanning is not supported at the moment.

Creates an advertising channel PDU suitable for building a simple beacon.

This is equivalent to PduBuf::nonconnectable_undirected.

Creates an advertising PDU that makes this device “visible” for scanning devices that want to establish a connection.

This should be used when this device would like to initiate pairing.

This function is mostly equivalent to PduBuf::connectable_undirected, but will automatically add a suitable Flags AD structure to the advertising data.

To establish a connection with an already paired device, a “directed” advertisement must be sent instead.

Creates a scan request PDU.

Note that scanning is not yet implemented.

Parameters

  • scanner: Device address of the device in scanning state (sender of the request).
  • adv: Device address of the advertising device that this scan request is directed towards.

Creates a scan response PDU.

Note that scanning is not yet implemented.

Trait Implementations

Formats the value using the given formatter. 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 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.