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

pub struct Channel(_);

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.

Methods

impl Channel[src]

pub const NULL: Self[src]

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

pub const ATT: Self[src]

The channel used by the Attribute Protocol (ATT).

pub const LE_SIGNALING: Self[src]

LE L2CAP signaling channel (connectionless).

pub const LE_SECURITY_MANAGER: Self[src]

LE Security Manager channel.

pub fn as_raw(&self) -> u16[src]

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

pub fn is_connection_oriented(&self) -> bool[src]

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.

pub fn is_connectionless(&self) -> bool[src]

Returns whether this channel is connectionless.

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

Trait Implementations

impl ToBytes for Channel[src]

impl<'_> FromBytes<'_> for Channel[src]

impl PartialEq<Channel> for Channel[src]

impl Eq for Channel[src]

impl Clone for Channel[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Channel[src]

impl Debug for Channel[src]

impl Hash for Channel[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

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

Auto Trait Implementations

impl Send for Channel

impl Sync for Channel

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]