Struct huawei_modem::HuaweiModem
source · pub struct HuaweiModem { /* private fields */ }
Expand description
A connection to an AT/Huawei-style modem.
Implementations§
source§impl HuaweiModem
impl HuaweiModem
sourcepub fn new_from_path<P: AsRef<Path>>(path: P, h: &Handle) -> HuaweiResult<Self>
pub fn new_from_path<P: AsRef<Path>>(path: P, h: &Handle) -> HuaweiResult<Self>
Start talking to the modem at a specified file path.
sourcepub fn new_from_file(f: File, h: &Handle) -> HuaweiResult<Self>
pub fn new_from_file(f: File, h: &Handle) -> HuaweiResult<Self>
Start talking to the modem represented by a given file handle.
The file handle provided must support non-blocking IO for this method to work.
sourcepub fn take_urc_rx(&mut self) -> Option<UnboundedReceiver<AtResponse>>
pub fn take_urc_rx(&mut self) -> Option<UnboundedReceiver<AtResponse>>
Retrieve the URC (Unsolicited Result Code) receiver from the modem (it can only be taken once).
This gives you an UnboundedReceiver
that provides you with a stream of AtResponse
s that
are unsolicited, i.e. they are proactive notifications from the modem of something
happening. On some modems, you may well receive a steady stream of random updates.
This can be useful when you configure your modem for message notification on delivery (see
cmd::sms::set_new_message_indications
), in which case you’ll want to check for CNMI
URCs through this receiver and use that to poll for new messages.
sourcepub fn send_raw(&mut self, cmd: AtCommand) -> ModemResponseFuture
pub fn send_raw(&mut self, cmd: AtCommand) -> ModemResponseFuture
Send a raw AT command to the modem.