read reply from tcp server

This commit is contained in:
Vladan Popovic 2022-06-21 02:30:00 +02:00
parent 55e5b0dc96
commit 10c61f5d78
3 changed files with 70 additions and 13 deletions

View file

@ -251,8 +251,27 @@ impl<UART: serial::Uart> Modem<UART> {
Ok(())
}
pub fn tcp_set_manual_receive(&mut self) -> Result<()> {
self.send_command(Command::tcp_set_manual_receive())?;
Ok(())
}
pub fn tcp_receive_query_len(&mut self) -> Result<()> {
self.send_command(Command::tcp_receive_query_len())?;
Ok(())
}
pub fn tcp_send(&mut self, payload: &str) -> Result<()> {
self.send_data(payload)?;
Ok(())
}
pub fn tcp_receive(&mut self, size: usize) -> Result<String> {
self.send_command(Command::tcp_receive(size))
}
pub fn tcp_close_connection(&mut self) -> Result<String> {
self.send_command(Command::tcp_close())
}
}