Struct Module

Source
pub struct Module<Rx, Tx, C, const N: usize>
where Rx: Read<u8> + 'static, Tx: Write<u8> + 'static, C: SimpleClock,
{ /* private fields */ }
Expand description

Basic communication interface with the esp8266 module.

Provides basic functionality for sending AT commands and getting corresponding responses.

Implementations§

Source§

impl<'a, Rx, Tx, C, const N: usize> Module<Rx, Tx, C, N>
where Rx: Read<u8> + 'static, Tx: Write<u8> + 'static, C: SimpleClock,

Source

pub fn new(rx: Rx, tx: Tx, clock: C) -> Result<Self>

Establishes serial communication with the esp8266 module.

Source

pub fn set_timeout(&mut self, us: Option<u64>)

Sets the operation timeout to the timeout specified.

If the specified value is None, the operations will block infinitely.

Source

pub fn reset(&mut self) -> Result<()>

Performs the module resetting routine.

Source

pub fn send_at_command<T: AtCommand>( &mut self, cmd: T, ) -> Result<Result<ReadData<'_, N>, ReadData<'_, N>>>

Sends an AT command and gets the response for it.

Trait Implementations§

Source§

impl<Rx, Tx, C, const N: usize> Debug for Module<Rx, Tx, C, N>
where Rx: Read<u8> + 'static + Debug, Tx: Write<u8> + 'static + Debug, C: SimpleClock + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Rx, Tx, C, const N: usize> Freeze for Module<Rx, Tx, C, N>
where C: Freeze, Rx: Freeze, Tx: Freeze,

§

impl<Rx, Tx, C, const N: usize> RefUnwindSafe for Module<Rx, Tx, C, N>

§

impl<Rx, Tx, C, const N: usize> Send for Module<Rx, Tx, C, N>
where C: Send, Rx: Send, Tx: Send,

§

impl<Rx, Tx, C, const N: usize> Sync for Module<Rx, Tx, C, N>
where C: Sync, Rx: Sync, Tx: Sync,

§

impl<Rx, Tx, C, const N: usize> Unpin for Module<Rx, Tx, C, N>
where C: Unpin, Rx: Unpin, Tx: Unpin,

§

impl<Rx, Tx, C, const N: usize> UnwindSafe for Module<Rx, Tx, C, N>
where C: UnwindSafe, Rx: UnwindSafe, Tx: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.