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

pub enum ControlPdu<'a> {
    ConnectionUpdateReq(&'a ConnectionUpdateData),
    ChannelMapReq(&'a ChannelMapReq),
    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>,
    },
    ConnectionParamReq(ConnectionParamRequest),
    ConnectionParamRsp(ConnectionParamRequest),
    Unknown {
        opcode: ControlOpcode,
        ctr_data: &'a [u8],
    },
}
Expand description

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

Variants

ConnectionUpdateReq(&'a ConnectionUpdateData)

0x00/LL_CONNECTION_UPDATE_REQ - Update connection parameters.

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

Tuple Fields of ConnectionUpdateReq

0: &'a ConnectionUpdateData
ChannelMapReq(&'a ChannelMapReq)

0x01/LL_CHANNEL_MAP_REQ - Update the channel map.

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

Tuple Fields of ChannelMapReq

0: &'a ChannelMapReq
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>
ConnectionParamReq(ConnectionParamRequest)

Tuple Fields of ConnectionParamReq

0: ConnectionParamRequest
ConnectionParamRsp(ConnectionParamRequest)

Tuple Fields of ConnectionParamRsp

0: ConnectionParamRequest
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.

Implementations

Returns the opcode of this LL Control PDU.

Returns the encoded size of this LLCPDU, including the opcode byte.

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

Performs the conversion.

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

Converts self to bytes and writes them into writer, advancing writer to point past the encoded value. 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.