From fccbf981558bea576c64e8128b0ce16edb7ad709 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 20 Jun 2022 00:38:00 +0200 Subject: [PATCH] restore the received message (including \r\n in the end) --- src/modem.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modem.rs b/src/modem.rs index 588f768..87f908b 100644 --- a/src/modem.rs +++ b/src/modem.rs @@ -121,7 +121,7 @@ impl Modem { // // This check here is tested on sim800l and works only because the modem has \r\n as CRLF. if line.ends_with("\r") { - Ok(line[0..line.len()-1].to_string()) + Ok(format!("{}\n", line)) } else { Err(ModemError::ReadError)