From 63359cc4c08483d4cc39c77f7a8b427ad6ac46a8 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Wed, 20 Jul 2022 12:27:42 +0200 Subject: [PATCH] TODO: handle reading lines in a bettwr way --- src/serial.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serial.rs b/src/serial.rs index 817fb67..79c6b12 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -101,6 +101,8 @@ impl SerialIO { .take_while(|c| *c != '\n') .collect(); + // TODO: \r\n is true for sim800l, but might not be valud for other devices. Re-implement + // this function so that it can be used on all devices. // \r must come right before \n on read; take_while excludes the matched element. if line.ends_with('\r') { line.push('\n');