Skip to main content

AtContext

Trait AtContext 

Source
pub trait AtContext<const SIZE: usize> {
    // Provided methods
    fn exec(&self) -> AtResult<SIZE> { ... }
    fn query(&mut self) -> AtResult<SIZE> { ... }
    fn test(&mut self) -> AtResult<SIZE> { ... }
    fn set(&mut self, _args: Args<'_>) -> AtResult<SIZE> { ... }
}
Expand description

Trait that defines the context for AT command execution. Implementations of this trait handle the actual logic for each AT command form.

The const generic SIZE defines the size (in bytes) of the response buffer returned by command handlers.

Provided Methods§

Source

fn exec(&self) -> AtResult<SIZE>

Execute command (AT+CMD) This is called when a command is invoked without any suffix.

Source

fn query(&mut self) -> AtResult<SIZE>

Query command (AT+CMD?) This is called to retrieve the current value/state of a command.

Source

fn test(&mut self) -> AtResult<SIZE>

Test command (AT+CMD=?) This is called to check if a command is supported or to get valid parameter ranges.

Source

fn set(&mut self, _args: Args<'_>) -> AtResult<SIZE>

Set command (AT+CMD=args) This is called to set parameters for a command.

Implementors§