Skip to main content

CmuxSession

Struct CmuxSession 

Source
pub struct CmuxSession { /* private fields */ }
Expand description

Active GSM 07.10 multiplexer on a physical serial port.

Implementations§

Source§

impl CmuxSession

Source

pub fn new(physical_path: String, io: Arc<dyn CmuxPhysicalIo>) -> Arc<Self> ⓘ

Session with the basic-option default N1 (31, the 4.0.0 behaviour); Self::with_n1 for the N1 given to AT+CMUX.

Source

pub fn with_n1( physical_path: String, io: Arc<dyn CmuxPhysicalIo>, n1: usize, ) -> Arc<Self> ⓘ

n1: the negotiated maximum frame size (AT+CMUX N1, see cmux_n1). Frames up to max(n1, DEFAULT_MAX_RX_INFO) info bytes are accepted.

Source

pub fn physical_path(&self) -> &str

Source

pub fn register_dlci(&self, dlci: u8, virtual_path: String) -> Arc<DlciChannel> ⓘ

Source

pub fn unregister_dlci(&self, dlci: u8)

Source

pub fn has_dlci(&self, dlci: u8) -> bool

Source

pub fn open_dlci(&self, dlci: u8, timeout: Duration) -> Result<(), String>

Establish a DLC: send SABM and wait for the modem’s UA (DM = refused). DLCI 0 (the control channel) must be opened first.

Source

pub fn close_down(&self)

Ask the modem to leave multiplexer mode (CLD on the control channel).

Source

pub fn tick(&self)

Batch-timeout flush for virtual-channel watches (called from the hub tick).

Source

pub fn emit_disconnect(&self, reason: &str)

Physical link lost: every channel watch gets its remainder, then Disconnect with the channel’s virtual path.

Source

pub fn set_watch_with( &self, dlci: u8, channel: EventSink, batch_timeout_ms: u64, framer: Option<Box<dyn Framer>>, )

Source

pub fn clear_watch(&self, dlci: u8)

Stop the channel watch; its parser remainder is the last Data. The sink runs here, so call with no manager lock held.

Source

pub fn set_exchange_waiter(&self, dlci: u8, waiter: Arc<ExchangeWaiter>)

Source

pub fn clear_exchange_waiter(&self, dlci: u8)

Source

pub fn cancel_active_exchange(&self, dlci: u8)

Fail the in-flight exchange waiter on dlci (used by cancel_exchange).

Source

pub fn send_uih(&self, dlci: u8, payload: &[u8]) -> Result<usize, String>

Source

pub fn feed_physical_rx(&self, chunk: &[u8])

Feed raw bytes from the physical RX hub thread.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.