pub struct HuaweiModem { /* private fields */ }
Expand description

A connection to an AT/Huawei-style modem.

Implementations§

source§

impl HuaweiModem

source

pub fn new_from_path<P: AsRef<Path>>(path: P, h: &Handle) -> HuaweiResult<Self>

Start talking to the modem at a specified file path.

source

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.

source

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 AtResponses 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.

source

pub fn send_raw(&mut self, cmd: AtCommand) -> ModemResponseFuture

Send a raw AT command to the modem.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.