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.
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). 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).
Sourcepub fn emit_disconnect(&self, reason: &str)
pub fn emit_disconnect(&self, reason: &str)
Physical link lost: 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 parser remainder is the last Data. 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).
pub fn send_uih(&self, dlci: u8, payload: &[u8]) -> Result<usize, String>
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.