From b6f9b3c30c558ce8d120b4ba540937dbc3146fcd Mon Sep 17 00:00:00 2001 From: Technobly Date: Tue, 30 Mar 2021 20:21:31 -0500 Subject: [PATCH] Fixes parsing of +CEDRXS for R510 --- hal/network/ncp_client/sara/sara_ncp_client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hal/network/ncp_client/sara/sara_ncp_client.cpp b/hal/network/ncp_client/sara/sara_ncp_client.cpp index aceb3e1670..66c6fed84a 100644 --- a/hal/network/ncp_client/sara/sara_ncp_client.cpp +++ b/hal/network/ncp_client/sara/sara_ncp_client.cpp @@ -1334,8 +1334,12 @@ int SaraNcpClient::initReady(ModemState state) { resp = parser_.sendCommand("AT+CEDRXS?"); while (resp.hasNextLine()) { unsigned act = 0; - r = resp.scanf("+CEDRXS: %u", &act); - if (r == 1) { // Ignore scanf() errors + unsigned eDRXCycle = 0; + unsigned pagingTimeWindow = 0; + // R410 disabled: +CEDRXS: + // R510 disabled: +CEDRXS: 4,"0000" + r = resp.scanf("+CEDRXS: %u,\"%d\",\"%d\"", &act, &eDRXCycle, &pagingTimeWindow); + if (r >= 1 && (eDRXCycle != 0 || pagingTimeWindow != 0)) { // Ignore scanf() errors CHECK_TRUE(acts.append(act), SYSTEM_ERROR_NO_MEMORY); } }