Struct rubble::link::Responder[][src]

pub struct Responder<C: Config> {
    tx: <<C as Config>::PacketQueue as PacketQueue>::Producer,
    rx: Option<<<C as Config>::PacketQueue as PacketQueue>::Consumer>,
    l2cap: L2CAPState<C::ChannelMapper>,
}
Expand description

Data channel packet processor.

This hooks up to the Real-Time part of the LE Link Layer via a packet queue. This part can run at a lower priority (eg. being driven in the apps idle loop) and receives and transmits packets using the packet queue.

Some LL Control PDUs sent as part of the Link Layer Control Protocol (LLCP) are answered by the responder directly, and all L2CAP data is forwarded to an L2CAPState<M>. Note that most LLCPDUs are handled directly by the real-time code.

Fields

tx: <<C as Config>::PacketQueue as PacketQueue>::Producerrx: Option<<<C as Config>::PacketQueue as PacketQueue>::Consumer>l2cap: L2CAPState<C::ChannelMapper>

Implementations

Creates a new packet processor hooked up to data channel packet queues.

Returns true when this responder has work to do.

If this returns true, process may be called to process incoming packets and send outgoing ones.

Processes a single incoming packet in the packet queue.

Returns Error::Eof if there are no incoming packets in the RX queue.

Obtains access to the L2CAP instance.

A helper method that splits self into the rx and the remaining Self.

This can possibly be removed after RFC 2229 (Closures Capture Disjoint Fields) is implemented in stable Rust.

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 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.