[−][src]Trait atat::AtatClient
Required methods
fn send<A: AtatCmd>(&mut self, cmd: &A) -> Result<A::Response, Error>
Send an AT command.
cmd must implement AtatCmd.
This function will block until a response is received, if in Timeout or
Blocking mode. In Nonblocking mode, the send can be called until it no
longer returns nb::Error::WouldBlock, or self.check_response(cmd) can
be called, with the same result.
This function will also make sure that atleast self.config.cmd_cooldown
has passed since the last response or URC has been received, to allow
the slave AT device time to deliver URC's.
fn check_urc<URC: AtatUrc>(&mut self) -> Option<URC::Response>
Checks if there are any URC's (Unsolicited Response Code) in queue from the ingress manager.
Example:
use atat::atat_derive::{AtatResp, AtatUrc}; #[derive(Clone, AtatResp)] pub struct MessageWaitingIndication { #[at_arg(position = 0)] pub status: u8, #[at_arg(position = 1)] pub code: u8, } #[derive(Clone, AtatUrc)] pub enum Urc { #[at_urc("+UMWI")] MessageWaitingIndication(MessageWaitingIndication), } // match client.check_urc::<Urc>() { // Some(Urc::MessageWaitingIndication(MessageWaitingIndication { status, code })) => { // // Do something to act on `+UMWI` URC // } // }
fn check_response<A: AtatCmd>(&mut self, cmd: &A) -> Result<A::Response, Error>
Check if there are any responses enqueued from the ingress manager.
The function will return nb::Error::WouldBlock until a response or an
error is available, or a timeout occurs and config.mode is Timeout.
This function is usually only called through send.
fn get_mode(&self) -> Mode
Get the configured mode of the client.
Options are:
NonBlockingBlockingTimeout
Implementors
impl<Tx, T, BufLen, ComCapacity, ResCapacity, UrcCapacity> AtatClient for Client<Tx, T, BufLen, ComCapacity, ResCapacity, UrcCapacity> where
Tx: Write<u8>,
T: CountDown,
T::Time: From<u32>,
BufLen: ArrayLength<u8>,
ComCapacity: ArrayLength<Command>,
ResCapacity: ArrayLength<Result<Vec<u8, BufLen>, Error>>,
UrcCapacity: ArrayLength<Vec<u8, BufLen>>, [src]
Tx: Write<u8>,
T: CountDown,
T::Time: From<u32>,
BufLen: ArrayLength<u8>,
ComCapacity: ArrayLength<Command>,
ResCapacity: ArrayLength<Result<Vec<u8, BufLen>, Error>>,
UrcCapacity: ArrayLength<Vec<u8, BufLen>>,