pub struct EspAt<S> { /* private fields */ }
Expand description
esp-at driver for ESP32, ESP8266, ESP8285.
Implementations§
Source§impl<S, ER, EW> EspAt<S>
impl<S, ER, EW> EspAt<S>
pub fn new(serial: S) -> Self
pub fn send_command(&mut self, cmd: &str) -> Result<(), EspAtError<ER, EW>>
pub fn last_read(&self) -> &str
pub fn read_response(&mut self) -> Result<&str, EspAtError<ER, EW>>
pub fn skip_to_next(&mut self)
Sourcepub fn echo_off(&mut self) -> Result<(), EspAtError<ER, EW>>
pub fn echo_off(&mut self) -> Result<(), EspAtError<ER, EW>>
ATE0
Sourcepub fn echo_on(&mut self) -> Result<(), EspAtError<ER, EW>>
pub fn echo_on(&mut self) -> Result<(), EspAtError<ER, EW>>
ATE1
Sourcepub fn ifconfig(&mut self) -> Result<(&str, &str, &str), EspAtError<ER, EW>>
pub fn ifconfig(&mut self) -> Result<(&str, &str, &str), EspAtError<ER, EW>>
(ip, gateway, netmask)
Sourcepub fn iwconfig(&mut self) -> Result<(&str, &str, u8), EspAtError<ER, EW>>
pub fn iwconfig(&mut self) -> Result<(&str, &str, u8), EspAtError<ER, EW>>
pub fn cwjap( &mut self, ssid: &str, password: &str, ) -> Result<(), EspAtError<ER, EW>>
pub fn tcp_send( &mut self, host: &str, port: u16, buf: &[u8], ) -> Result<(), EspAtError<ER, EW>>
pub fn connect_tcp( &mut self, host: &str, port: u16, ) -> Result<(), EspAtError<ER, EW>>
Sourcepub fn skip_read(&mut self) -> Result<(), EspAtError<ER, EW>>
pub fn skip_read(&mut self) -> Result<(), EspAtError<ER, EW>>
Skip all possible data. Skip and send “AT”, if it returns OK, then all read data is received.
Sourcepub fn read(&mut self) -> Result<&[u8], EspAtError<ER, EW>>
pub fn read(&mut self) -> Result<&[u8], EspAtError<ER, EW>>
Read a packet
Sourcepub fn close(&mut self) -> Result<(), EspAtError<ER, EW>>
pub fn close(&mut self) -> Result<(), EspAtError<ER, EW>>
AT+CIPCLOSE
pub fn http_post( &mut self, url: &str, data: &str, ) -> Result<&str, EspAtError<ER, EW>>
Auto Trait Implementations§
impl<S> Freeze for EspAt<S>where
S: Freeze,
impl<S> RefUnwindSafe for EspAt<S>where
S: RefUnwindSafe,
impl<S> Send for EspAt<S>where
S: Send,
impl<S> Sync for EspAt<S>where
S: Sync,
impl<S> Unpin for EspAt<S>where
S: Unpin,
impl<S> UnwindSafe for EspAt<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more