pub struct AtDigester<P: Parser> { /* private fields */ }
Expand description

A Digester that tries to implement the basic AT standard. This digester should work for most usecases of ATAT.

Implements a request-response AT digester capable of working with or without AT echo enabled.

Buffer can contain (‘…’ meaning arbitrary data):

  • ‘…AT<CMD>\r\r\n<RESPONSE>\r\n<RESPONSE CODE>\r\n…’ (Echo enabled)
  • ‘…AT<CMD>\r\r\n<CMD>: <PARAMETERS>\r\n<RESPONSE CODE>\r\n…’ (Echo enabled)
  • ‘…AT<CMD>\r\r\n<RESPONSE CODE>\r\n…’ (Echo enabled)
  • ‘…<CMD>:<PARAMETERS>\r\n<RESPONSE CODE>\r\n…’ (Echo disabled)
  • ‘…<RESPONSE>\r\n<RESPONSE CODE>\r\n…’ (Echo disabled)
  • ‘…<URC>\r\n…’ (Unsolicited response code)
  • ‘…<URC>:<PARAMETERS>\r\n…’ (Unsolicited response code)
  • ‘…<PROMPT>’ (Prompt for data)

Goal of the digester is to extract these into:

  • DigestResult::Response(Result<RESPONSE>)
  • DigestResult::Urc(<URC>)
  • DigestResult::Prompt(<CHAR>)
  • DigestResult::None

Usually <RESPONSE CODE> is one of [‘OK’, ‘ERROR’, ‘CME ERROR: <NUMBER/STRING>’, ‘CMS ERROR: <NUMBER/STRING>’], but can be others as well depending on manufacturer.

Usually <PROMPT> can be one of [‘>’, ‘@’], and is command specific and only valid for few selected commands.

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.