From fac3115a93d7b0e599bdd63e7867ea0e97a5ccd6 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 20 Jun 2022 00:03:44 +0200 Subject: [PATCH] add tcp send/receive command modes --- src/command.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/command.rs b/src/command.rs index 73470d9..a007a23 100644 --- a/src/command.rs +++ b/src/command.rs @@ -279,6 +279,22 @@ impl Command { } } + pub fn tcp_transparent_mode() -> Command { + Command { + text: "AT+CIPMODE=1".to_string(), + timeout: Duration::from_millis(3000), + contains: Some("OK".to_string()), + } + } + + pub fn tcp_exit_data_mode() -> Command { + Command { + text: "ATO".to_string(), + timeout: Duration::from_millis(3000), + contains: Some("CLOSED".to_string()), + } + } + pub fn tcp_send() -> Command { Command { text: "AT+CIPSEND".to_string(),