File tree 2 files changed +25
-3
lines changed
Filter options
2 files changed +25
-3
lines changed
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
62
62
const bool emergencyReset = restart || isCmuxEnable ();
63
63
DEBUG_INFO (" Emergency reset %s" , emergencyReset ? " enabled" : " disabled" );
64
64
if (emergencyReset) {
65
- reset ();
65
+ hardwareReset ();
66
66
}
67
67
68
68
/* Create rising edge on pin ON */
@@ -140,6 +140,18 @@ void arduino::GSMClass::end() {
140
140
}
141
141
}
142
142
143
+ void arduino::GSMClass::reset () {
144
+ if (_device) {
145
+ _device->soft_reset ();
146
+ }
147
+ }
148
+
149
+ void arduino::GSMClass::off () {
150
+ if (_device) {
151
+ _device->soft_power_off ();
152
+ }
153
+ }
154
+
143
155
int arduino::GSMClass::ping (const char * hostname, int ttl) {
144
156
145
157
mbed::GEMALTO_CINTERION_CellularStack* stack = (mbed::GEMALTO_CINTERION_CellularStack*)_context->get_stack ();
@@ -215,7 +227,7 @@ NetworkInterface* arduino::GSMClass::getNetwork() {
215
227
return _context;
216
228
}
217
229
218
- void arduino::GSMClass::reset () {
230
+ void arduino::GSMClass::hardwareReset () {
219
231
/* Reset logic is inverted */
220
232
pinMode (MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
221
233
digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, HIGH);
Original file line number Diff line number Diff line change @@ -100,6 +100,16 @@ class GSMClass : public MbedSocketClass {
100
100
*/
101
101
void end (void );
102
102
103
+ /*
104
+ * Send AT+CFUN=1,1 command to trigger a software reset. To be called only after end();
105
+ */
106
+ void reset ();
107
+
108
+ /*
109
+ * Send AT^SMSO="fast command to power off the modem. To be called only after end();
110
+ */
111
+ void off ();
112
+
103
113
/*
104
114
* Change cellular state timeouts. Needs to be called before GSM.begin()
105
115
*/
@@ -157,7 +167,7 @@ class GSMClass : public MbedSocketClass {
157
167
static const char * getRegistrationStateString (const mbed::CellularNetwork::RegistrationStatus state);
158
168
void onStatusChange (nsapi_event_t ev, intptr_t in);
159
169
160
- void reset ();
170
+ void hardwareReset ();
161
171
void on ();
162
172
};
163
173
You can’t perform that action at this time.
0 commit comments