Skip to content

Commit

Permalink
share latest CEDRXS code
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellanova committed Apr 15, 2021
1 parent 6a1436a commit af55f74
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions hal/src/electron/modem/mdm_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,22 +709,23 @@ int MDMParser::_cbCEDRXS(int type, const char* buf, int len, EdrxActs* edrxActs)
if (((type == TYPE_PLUS) || (type == TYPE_UNKNOWN)) && edrxActs) {
// if response is "\r\n+CEDRXS:\r\n", all AcT's disabled, do nothing
if (strncmp(buf, "\r\n+CEDRXS:\r\n", len) != 0) {
int a;
if (sscanf(buf, "\r\n+CEDRXS: %1d[2-5]", &a) == 1 ||
sscanf(buf, "+CEDRXS: %1d[2-5]", &a) == 1 ) {
int act;
if (sscanf(buf, "\r\n+CEDRXS: %1d[2-5]", &act) == 1 ||
sscanf(buf, "+CEDRXS: %1d[2-5]", &act) == 1 ) {
if (edrxActs->count < MDM_R410_EDRX_ACTS_MAX) {
edrxActs->act[edrxActs->count++] = a;
edrxActs->act[edrxActs->count++] = act;
}
}
else {
// TODO R510 verify below works with:
// +CEDRXS: 4,\"0000\"
// "\r\n+CEDRXS: 4,\"0000\"\r\n"
unsigned eDRXCycle = 0;
if (sscanf(buf, "\r\n+CEDRXS: %u,\"%d\"", &a, &eDRXCycle) == 2 ||
sscanf(buf, "+CEDRXS: %u,\"%d\"", &a, &eDRXCycle) == 2 ) {
if (eDRXCycle != 0 ) {
edrxActs->act[edrxActs->count++] = a;
unsigned pagingTimeWindow = 0;
if (sscanf(buf,"\r\n+CEDRXS: %u,\"%d\",\"%d\"", &act, &eDRXCycle, &pagingTimeWindow) >= 1 ||
sscanf(buf,"+CEDRXS: %u,\"%d\",\"%d\"", &act, &eDRXCycle, &pagingTimeWindow) >= 1) {
if (eDRXCycle != 0 || pagingTimeWindow != 0) { // Ignore scanf() errors
edrxActs->act[edrxActs->count++] = act;
}
}
}
Expand Down Expand Up @@ -1281,7 +1282,7 @@ bool MDMParser::init(DevStatus* status)
// Reset the detected count each time we check for eDRX AcTs enabled
EdrxActs _edrxActs;
if (RESP_ERROR == waitFinalResp(_cbCEDRXS, &_edrxActs, CEDRXS_TIMEOUT)) {
MDM_ERROR("_cbCEDRXS waitResp failed\r\n");
MDM_ERROR("_cbCEDRXS waitResp failed");
goto reset_failure;
}
for (int i = 0; i < _edrxActs.count; i++) {
Expand All @@ -1290,7 +1291,7 @@ bool MDMParser::init(DevStatus* status)
resetNeeded = true;
}
if (resetNeeded) {
MDM_ERROR("resetNeeded after CEDRXS\r\n");
MDM_ERROR("resetNeeded after CEDRXS");
goto reset_failure;
}
} // if (_dev.dev == DEV_SARA_R410)
Expand Down

0 comments on commit af55f74

Please sign in to comment.