From f7f0689f46ecc6978d2fb54252b751ebbe6e545f Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 8 Aug 2022 12:54:29 +0200 Subject: [PATCH] add a todo for sim800l response parsing --- src/modem.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modem.rs b/src/modem.rs index 93ff631..35f567f 100644 --- a/src/modem.rs +++ b/src/modem.rs @@ -223,6 +223,12 @@ impl Modem { loop { let reply = self.send_command(Command::tcp_receive(MAX_TCP_MANUAL_REPLY_SIZE)) .map(|reply| { + // TODO: parse the response properly + // 1. the first line is \r\n + // 2. next is the +CIPRXGET: 2,X,Y where X is the number of bytes read and Y is + // the number of bytes left to be read + // 3. immediately after this the payload is returned (with size X) + // 4. OK reply .split("\r\n") .filter(|line| line.len() > 2 && !line.contains("+CIPRXGET: 2,"))