read reply from tcp server
This commit is contained in:
parent
55e5b0dc96
commit
10c61f5d78
3 changed files with 70 additions and 13 deletions
|
@ -310,4 +310,36 @@ impl Command {
|
|||
contains: Some("OK".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tcp_receive(size: usize) -> Command {
|
||||
Command {
|
||||
text: format!("AT+CIPRXGET=2,{}", size),
|
||||
timeout: Duration::from_millis(3000),
|
||||
contains: Some("OK".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tcp_receive_query_len() -> Command {
|
||||
Command {
|
||||
text: "AT+CIPRXGET=4".to_string(),
|
||||
timeout: Duration::from_millis(3000),
|
||||
contains: Some("OK".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tcp_set_manual_receive() -> Command {
|
||||
Command {
|
||||
text: "AT+CIPRXGET=1".to_string(),
|
||||
timeout: Duration::from_millis(3000),
|
||||
contains: Some("OK".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tcp_close() -> Command {
|
||||
Command {
|
||||
text: "AT+CIPCLOSE=0".to_string(),
|
||||
timeout: Duration::from_millis(3000),
|
||||
contains: Some("CLOSE OK".to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue