drx
Revision 31:11d3c0c907d6, committed 2019-07-31
- Comitter:
- fahimalavi
- Date:
- Wed Jul 31 17:36:51 2019 +0500
- Parent:
- 30:c57aea1e9cd4
- Commit message:
- EDRX fix added
Changed in this revision
UbloxCellularBase.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c57aea1e9cd4 -r 11d3c0c907d6 UbloxCellularBase.cpp --- a/UbloxCellularBase.cpp Tue Jul 30 18:02:36 2019 +0500 +++ b/UbloxCellularBase.cpp Wed Jul 31 17:36:51 2019 +0500 @@ -1660,10 +1660,7 @@ for (int i = binary_string_length - 1; i >= 0; i--) { if (binary_string[i] == '1') { - integer_output += base_exp; - } - if (binary_string[i] != '\0') { - base_exp <<= 1; + integer_output += (base_exp << (binary_string_length - (i+1))); } } @@ -1735,7 +1732,7 @@ } uint32_t UbloxCellularBase::get_receive_period() { - uint32_t edrx_value = 0xFFFFFFFF; + uint32_t edrx_value = 2; char buf[24] = {0x00}; char edrx_val[5]; tEDRXAccessTechnology act_type; @@ -1743,12 +1740,17 @@ LOCK(); if (_at->send("AT+CEDRXS?") && _at->recv("%23[^\n]\nOK\n", buf)) { - if (sscanf(buf, "+CEDRXS: %d,%s", (int *)act_type, edrx_val) == 2) { + if (sscanf(buf, "+CEDRXS: %d,\"%s\"", (int *)&act_type, edrx_val) == 2) { - edrx_value = binary_str_to_uint((const char *)edrx_val,4); + edrx_value = binary_str_to_uint(edrx_val,4); } } + if (_at->send("AT+CEDRXRDP") && _at->recv("OK")) { + } + + tr_info("edrx_value. %d", edrx_value); + UNLOCK(); return edrx_value; }