[−][src]Struct rubble::link::advertising::PduBuf
Stores an advertising channel PDU.
This is an owned version of Pdu
and should be used when creating a PDU
to be sent out.
Methods
impl PduBuf
[src]
pub fn connectable_undirected(
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
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.
pub fn connectable_directed(
advertiser_addr: DeviceAddress,
initiator_addr: DeviceAddress
) -> Self
[src]
advertiser_addr: DeviceAddress,
initiator_addr: DeviceAddress
) -> Self
Creates a connectable directed advertising PDU (ADV_DIRECT_IND
).
pub fn nonconnectable_undirected(
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
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.
pub fn scannable_undirected(
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
Creates a scannable undirected advertising PDU (ADV_SCAN_IND
).
Note that scanning is not supported at the moment.
pub fn beacon(
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
Creates an advertising channel PDU suitable for building a simple beacon.
This is mostly equivalent to PduBuf::nonconnectable_undirected
, but it
will automatically add a suitable Flags
AD structure to the
advertising data (this flags is mandatory).
pub fn discoverable(
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
advertiser_data: &[AdStructure]
) -> Result<Self, Error>
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.
pub fn scan_request(
_scanner: DeviceAddress,
_adv: DeviceAddress
) -> Result<Self, Error>
[src]
_scanner: DeviceAddress,
_adv: DeviceAddress
) -> Result<Self, Error>
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.
pub fn scan_response(
advertiser_addr: DeviceAddress,
scan_data: &[AdStructure]
) -> Result<Self, Error>
[src]
advertiser_addr: DeviceAddress,
scan_data: &[AdStructure]
) -> Result<Self, Error>
Creates a scan response PDU.
Note that scanning is not yet implemented.
pub fn header(&self) -> Header
[src]
pub fn payload(&self) -> &[u8]
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
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> From for T
[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,