pub struct CmuxSession { /* private fields */ }Expand description
Active GSM 07.10 multiplexer on a physical serial port.
Implementations§
Source§impl CmuxSession
impl CmuxSession
Sourcepub fn new(physical_path: String, io: Arc<dyn CmuxPhysicalIo>) -> Arc<Self> ⓘ
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.
Sourcepub fn with_n1(
physical_path: String,
io: Arc<dyn CmuxPhysicalIo>,
n1: usize,
) -> Arc<Self> ⓘ
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. One SABM
per open (4.x).
Sourcepub fn for_command(
physical_path: String,
io: Arc<dyn CmuxPhysicalIo>,
command: &str,
) -> Arc<Self> ⓘ
pub fn for_command( physical_path: String, io: Arc<dyn CmuxPhysicalIo>, command: &str, ) -> Arc<Self> ⓘ
Session for the AT+CMUX= command that started it: N1 (cmux_n1) and the
T1/N2/T2 timers (CmuxTimers::from_command).
pub fn physical_path(&self) -> &str
pub fn register_dlci(&self, dlci: u8, virtual_path: String) -> Arc<DlciChannel> ⓘ
pub fn unregister_dlci(&self, dlci: u8)
pub fn has_dlci(&self, dlci: u8) -> bool
Sourcepub fn open_dlci(&self, dlci: u8, timeout: Duration) -> Result<(), String>
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). SABM is
resent every T1, at most N2 times; the last try waits out timeout (at least T1).
A data DLC gets an MSC (V.24 signals ready) once established.
DLCI 0 (the control channel) must be opened first.
Sourcepub fn close_down(&self)
pub fn close_down(&self)
Ask the modem to leave multiplexer mode: CLD on the control channel, then wait up to T2 for its response. Channel writes fail from here on.
Sourcepub fn emit_disconnect(&self, reason: &str)
pub fn emit_disconnect(&self, reason: &str)
Physical link lost: the session ends (writes waiting on flow control fail), an
exchange in flight on a channel fails, and every channel watch gets its remainder,
then Disconnect with the channel’s virtual path.
pub fn set_watch_with( &self, dlci: u8, channel: EventSink, batch_timeout_ms: u64, framer: Option<Box<dyn Framer>>, )
Sourcepub fn clear_watch(&self, dlci: u8)
pub fn clear_watch(&self, dlci: u8)
Stop the channel watch; its batch and parser remainder are the last Data, before
this returns (a sink that calls it does not wait for another thread’s delivery). The
sink runs here, so call with no manager lock held.
pub fn set_exchange_waiter(&self, dlci: u8, waiter: Arc<ExchangeWaiter>)
pub fn clear_exchange_waiter(&self, dlci: u8)
Sourcepub fn cancel_active_exchange(&self, dlci: u8)
pub fn cancel_active_exchange(&self, dlci: u8)
Fail the in-flight exchange waiter on dlci (used by cancel_exchange).
Sourcepub fn send_uih(&self, dlci: u8, payload: &[u8]) -> Result<usize, String>
pub fn send_uih(&self, dlci: u8, payload: &[u8]) -> Result<usize, String>
Send payload on dlci as UIH frames. While the modem holds flow control off
(FCoff, or MSC with FC=1 for this DLC) the write waits for it to end, at most the
write timeout of the frames, then fails; nothing is queued to go out later.
Sourcepub fn feed_physical_rx(&self, chunk: &[u8])
pub fn feed_physical_rx(&self, chunk: &[u8])
Feed raw bytes from the physical RX hub thread.