[][src]Enum rubble::link::data::ControlPdu

pub enum ControlPdu<'a> {
    ConnectionUpdateReq(ConnectionUpdateData),
    ChannelMapReq {
        map: ChannelMap,
        instant: u16,
    },
    TerminateInd {
        error_code: Hex<u8>,
    },
    UnknownRsp {
        unknown_type: ControlOpcode,
    },
    FeatureReq {
        features_master: FeatureSet,
    },
    FeatureRsp {
        features_used: FeatureSet,
    },
    VersionInd {
        vers_nr: VersionNumber,
        comp_id: CompanyId,
        sub_vers_nr: Hex<u16>,
    },
    Unknown {
        opcode: ControlOpcode,
        ctr_data: &'a [u8],
    },
}

A structured representation of an LL Control PDU used by the Link Layer Control Protocol (LLCP).

Variants

ConnectionUpdateReq(ConnectionUpdateData)

0x00/LL_CONNECTION_UPDATE_REQ - Update connection parameters.

Sent by the master. The slave does not send a response back.

ChannelMapReq

0x01/LL_CHANNEL_MAP_REQ - Update the channel map.

Sent by the master. The slave does not send a response back.

Fields of ChannelMapReq

map: ChannelMapinstant: u16
TerminateInd

0x02/LL_TERMINATE_IND - Close the connection.

Can be sent by master or slave.

Fields of TerminateInd

error_code: Hex<u8>
UnknownRsp

0x07/LL_UNKNOWN_RSP - Response to unknown/unsupported LL Control PDUs.

This is returned as a response to an incoming LL Control PDU when the opcode is unimplemented or unknown, or when the CtrData is invalid for the opcode.

Fields of UnknownRsp

unknown_type: ControlOpcode

Opcode of the unknown PDU.

FeatureReq

0x08/LL_FEATURE_REQ - Master requests slave's features.

Fields of FeatureReq

features_master: FeatureSet

Supported feature set of the master.

FeatureRsp

0x09/LL_FEATURE_RSP - Slave answers LL_FEATURE_REQ with the used feature set.

Fields of FeatureRsp

features_used: FeatureSet

Features that will be used for the connection. Logical AND of master and slave features.

VersionInd

0x0C/LL_VERSION_IND - Bluetooth version indication (sent by both master and slave).

When either master or slave receive this PDU, they should respond with their version if they have not already sent this PDU during this data connection (FIXME do this).

Fields of VersionInd

vers_nr: VersionNumbercomp_id: CompanyIdsub_vers_nr: Hex<u16>
Unknown

Catch-all variant for unsupported opcodes.

Fields of Unknown

opcode: ControlOpcode

The opcode we don't support. This can also be the Unknown variant.

ctr_data: &'a [u8]

Additional data depending on the opcode.

Methods

impl<'_> ControlPdu<'_>[src]

pub fn opcode(&self) -> ControlOpcode[src]

Returns the opcode of this LL Control PDU.

Trait Implementations

impl<'a> ToBytes for ControlPdu<'a>[src]

impl<'a> FromBytes<'a> for ControlPdu<'a>[src]

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

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

impl<'a> From<&'a ControlPdu<'a>> for Pdu<'a, &'a [u8]>[src]

impl<'a> Clone for ControlPdu<'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 ControlPdu<'a>

impl<'a> Sync for ControlPdu<'a>

Blanket Implementations

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> From for T[src]

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]