|
29 | 29 |
|
30 | 30 | static int const GSM_TIMEOUT = 30000; |
31 | 31 |
|
| 32 | +/****************************************************************************** |
| 33 | + FUNCTION DEFINITION |
| 34 | + ******************************************************************************/ |
| 35 | + |
| 36 | +__attribute__((weak)) void mkr_gsm_feed_watchdog() |
| 37 | +{ |
| 38 | + /* This function can be overwritten by a "strong" implementation |
| 39 | + * in a higher level application, such as the ArduinoIoTCloud |
| 40 | + * firmware stack. |
| 41 | + */ |
| 42 | +} |
| 43 | + |
32 | 44 | /****************************************************************************** |
33 | 45 | CTOR/DTOR |
34 | 46 | ******************************************************************************/ |
@@ -58,15 +70,21 @@ unsigned long GSMConnectionHandler::getTime() |
58 | 70 |
|
59 | 71 | NetworkConnectionState GSMConnectionHandler::update_handleInit() |
60 | 72 | { |
| 73 | + mkr_gsm_feed_watchdog(); |
| 74 | + |
61 | 75 | if (_gsm.begin(_pin) != GSM_READY) |
62 | 76 | { |
63 | 77 | Debug.print(DBG_ERROR, F("SIM not present or wrong PIN")); |
64 | 78 | return NetworkConnectionState::ERROR; |
65 | 79 | } |
66 | 80 |
|
| 81 | + mkr_gsm_feed_watchdog(); |
| 82 | + |
67 | 83 | Debug.print(DBG_INFO, F("SIM card ok")); |
68 | 84 | _gsm.setTimeout(GSM_TIMEOUT); |
69 | 85 |
|
| 86 | + mkr_gsm_feed_watchdog(); |
| 87 | + |
70 | 88 | GSM3_NetworkStatus_t const network_status = _gprs.attachGPRS(_apn, _login, _pass, true); |
71 | 89 | Debug.print(DBG_DEBUG, F("GPRS.attachGPRS(): %d"), network_status); |
72 | 90 | if (network_status == GSM3_NetworkStatus_t::ERROR) |
|
0 commit comments