Base class for the ublox-xxx-cellular-xxx classes. Cannot be used standalone, only inherited by classes that do properly useful stuff. Or, to put it another way, if you are using any of the ublox-xxx-cellular-xxx classes, you will need this class also.
Dependents: example-ublox-cellular-interface example-ublox-cellular-driver-gen HelloMQTT example-ublox-cellular-interface_r410M ... more
Revision 17:c6a4d5072589, committed 2018-09-13
- Comitter:
- Mudassar Hussain
- Date:
- Thu Sep 13 16:35:07 2018 +0500
- Branch:
- power_down
- Parent:
- 15:93b157a47b8d
- Child:
- 18:2c255818b3a9
- Commit message:
- power-down function updated
Changed in this revision
| UbloxCellularBase.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/UbloxCellularBase.cpp Thu Jul 12 10:13:45 2018 +0500
+++ b/UbloxCellularBase.cpp Thu Sep 13 16:35:07 2018 +0500
@@ -602,15 +602,20 @@
MBED_ASSERT(_at != NULL);
- // If we have been running, do a soft power-off first
- if (_modem_initialised && (_at != NULL)) {
- _at->send("AT+CPWROFF") && _at->recv("OK");
- }
-
- // Now do a hard power-off
+ // power-off modem
modem_power_down();
modem_deinit();
+ if (_modem_initialised && (_at != NULL)) {
+ int at_timeout = _at_timeout; // Save previous timeout
+ _at->set_timeout(1000);
+ // Check modem is powered off
+ if(_at->send("AT") && _at->recv("OK")) {
+ _at->send("AT+CPWROFF") && _at->recv("OK");
+ }
+ _at->set_timeout(at_timeout);
+ }
+
_dev_info.reg_status_csd = CSD_NOT_REGISTERED_NOT_SEARCHING;
_dev_info.reg_status_psd = PSD_NOT_REGISTERED_NOT_SEARCHING;
_dev_info.reg_status_eps = EPS_NOT_REGISTERED_NOT_SEARCHING;
u-blox