Struct rubble::l2cap::Channel[][src]

pub struct Channel(u16);
Expand description

An L2CAP channel identifier (CID).

Channels are basically like TCP ports. A Protocol can listen on a channel and is connected to a channel on the other device to which all responses are addressed.

A number of channel identifiers are reserved for predefined functions:

  • 0x0000: The null identifier. Must never be used as a destination endpoint.
  • 0x0001: L2CAP signaling channel (Classic Bluetooth only).
  • 0x0002: Connectionless channel (Classic Bluetooth only).
  • 0x0003: AMP manager (not relevant for Classic and LE Bluetooth).
  • 0x0004: Attribute protocol (ATT). BLE only.
  • 0x0005: LE L2CAP signaling channel.
  • 0x0006: LE Security Manager protocol.
  • 0x0007: Classic Bluetooth Security Manager protocol.
  • 0x0008-0x003E: Reserved.
  • 0x003F: AMP test manager (not relevant for Classic and LE Bluetooth).

For BLE, channels 0x0040-0x007F are dynamically allocated, while 0x0080 and beyond are reserved and should not be used (as of Bluetooth 4.2).

For classic Bluetooth, all channels 0x0040-0xFFFF are available for dynamic allocation.

Tuple Fields

0: u16

Implementations

The null channel identifier. Must not be used as a destination endpoint.

The channel used by the Attribute Protocol (ATT).

LE L2CAP signaling channel (connectionless).

LE Security Manager channel.

Returns the channel identifier (CID) as a raw u16.

Returns whether this channel is connection-oriented.

L2CAP PDUs addressed to connection-oriented channels are called B-frames if the channel is in “Basic Mode”, and can be either S-frames or I-frames if the channel is in retransmission/flow control/streaming modes.

Returns whether this channel is connectionless.

L2CAP PDUs addressed to connectionless channels are called G-frames.

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

Writes the defmt representation of self to fmt.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.