Class jac::Mux
template <class Encoder class Encoder>
A multiplexer that creates 256 channels on a single stream connection. More...
#include <mux.h>
Inherits the following classes: jac::DataLinkTx
Public Functions
Type | Name |
---|---|
Mux (std::unique_ptr< Duplex > stream) |
|
Mux (const Mux &) = delete |
|
Mux (Mux &&) = delete |
|
void | bindRx (std::unique_ptr< DataLinkRx > receiver) Bind a receiver to this mux. Received packets will be forwarded to the receiver. |
virtual std::unique_ptr< Packet > | buildPacket (uint8_t channel) override Build a packet for the given channel. |
virtual size_t | maxPacketSize () override const Get the maximum packet size for this mux. |
void | setErrorHandler (std::function< void(MuxError, std::any)> handler) Set the error handler for this mux. |
Public Functions inherited from jac::DataLinkTx
See jac::DataLinkTx
Type | Name |
---|---|
DataLinkTx () = default |
|
DataLinkTx (const DataLinkTx &) = delete |
|
DataLinkTx (DataLinkTx &&) = delete |
|
virtual std::unique_ptr< Packet > | buildPacket (uint8_t channel) = 0 Build a packet for the given channel. |
virtual size_t | maxPacketSize () const = 0 Get the maximum packet size for the given channel. |
DataLinkTx & | operator= (const DataLinkTx &) = delete |
DataLinkTx & | operator= (DataLinkTx &&) = delete |
Detailed Description
Template parameters:
Encoder
the encoder to use
Public Functions Documentation
function Mux [1/3]
function Mux [2/3]
function Mux [3/3]
function bindRx
Bind a receiver to this mux. Received packets will be forwarded to the receiver.
Parameters:
receiver
the receiver to bind
function buildPacket
Build a packet for the given channel.
Parameters:
channel
the channel
Returns:
The packet
Implements jac::DataLinkTx::buildPacket
function maxPacketSize
Get the maximum packet size for this mux.
Returns:
The maximum packet size
Implements jac::DataLinkTx::maxPacketSize
function setErrorHandler
Set the error handler for this mux.
Parameters:
handler
the error handler
The documentation for this class was generated from the following file src/jac/link/mux.h