[][src]Struct esp_01::Esp8266

pub struct Esp8266<Tx, Rx, Timer, Rst> where
    Tx: Write<u8>,
    Rx: Read<u8>,
    Timer: LongTimer,
    Rst: OutputPin
{ /* fields omitted */ }

Struct for interracting with an esp8266 wifi module over USART

Implementations

impl<Tx, Rx, Timer, Rst> Esp8266<Tx, Rx, Timer, Rst> where
    Tx: Write<u8>,
    Rx: Read<u8>,
    Timer: LongTimer,
    Rst: OutputPin
[src]

pub fn new(
    tx: Tx,
    rx: Rx,
    timer: Timer,
    chip_enable_pin: Rst
) -> Result<Self, Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

Sets up the esp8266 struct and configures the device for future use

tx and rx are the pins used for serial communication, timer is a hardware timer for dealing with things like serial timeout and chip_enable_pin is a pin which must be connected to the CHIP_EN pin of the device

pub fn send_data(
    &mut self,
    connection_type: ConnectionType,
    address: &str,
    port: u16,
    data: &str
) -> Result<(), TransmissionError<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

pub fn close_connection(
    &mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

pub fn power_down(
    &mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

Turns off the device by setting chip_enable to 0

pub fn reset(
    &mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

Resets the device by setting chip_enable to 0 and then back to 1

pub fn power_up(
    &mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

Turns the device back on by setting chip_enable to high

pub fn pull_some_current(
    &mut self
) -> Result<(), Error<Error<Rx::Error>, Tx::Error, Rst::Error>>
[src]

Auto Trait Implementations

impl<Tx, Rx, Timer, Rst> Send for Esp8266<Tx, Rx, Timer, Rst> where
    Rst: Send,
    Rx: Send,
    Timer: Send,
    Tx: Send

impl<Tx, Rx, Timer, Rst> Sync for Esp8266<Tx, Rx, Timer, Rst> where
    Rst: Sync,
    Rx: Sync,
    Timer: Sync,
    Tx: Sync

impl<Tx, Rx, Timer, Rst> Unpin for Esp8266<Tx, Rx, Timer, Rst> where
    Rst: Unpin,
    Rx: Unpin,
    Timer: Unpin,
    Tx: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.