read reply from tcp server
This commit is contained in:
parent
55e5b0dc96
commit
10c61f5d78
3 changed files with 70 additions and 13 deletions
19
src/modem.rs
19
src/modem.rs
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue