Struct embedded_drivers::esp_at::EspAt
source · pub struct EspAt<S> { /* private fields */ }
Expand description
esp-at driver for ESP32, ESP8266, ESP8285.
Implementations§
source§impl<S, ER, EW> EspAt<S>where
S: Read<u8, Error = ER> + Write<u8, Error = EW>,
impl<S, ER, EW> EspAt<S>where
S: Read<u8, Error = ER> + Write<u8, Error = EW>,
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