@@ -45,20 +45,8 @@ mbed::CellularDevice *mbed::CellularDevice::get_default_instance()
4545
4646int arduino::GSMClass::begin (const char * pin, const char * apn, const char * username, const char * password, RadioAccessTechnologyType rat, uint32_t band, bool restart) {
4747
48- if (restart || isCmuxEnable ()) {
49- pinMode (MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
50- digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, HIGH);
51- delay (800 );
52- digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, LOW);
53- pinMode (MBED_CONF_GEMALTO_CINTERION_ON, OUTPUT);
54- digitalWrite (MBED_CONF_GEMALTO_CINTERION_ON, LOW);
55- delay (1 );
56- digitalWrite (MBED_CONF_GEMALTO_CINTERION_ON, HIGH);
57- delay (1 );
58- // this timer is to make sure that at boottime and when the CMUX is used,
59- // ^SYSTART is received in time to avoid stranger behaviour
60- // from HW serial
61- delay (2000 );
48+ if (restart || isCmuxEnable ()) {
49+ reset ();
6250 }
6351
6452 _context = mbed::CellularContext::get_default_instance ();
@@ -162,4 +150,20 @@ NetworkInterface* arduino::GSMClass::getNetwork() {
162150 return _context;
163151}
164152
153+ void arduino::GSMClass::reset () {
154+ pinMode (MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
155+ digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, HIGH);
156+ delay (800 );
157+ digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, LOW);
158+ pinMode (MBED_CONF_GEMALTO_CINTERION_ON, OUTPUT);
159+ digitalWrite (MBED_CONF_GEMALTO_CINTERION_ON, LOW);
160+ delay (1 );
161+ digitalWrite (MBED_CONF_GEMALTO_CINTERION_ON, HIGH);
162+ delay (1 );
163+ // this timer is to make sure that at boottime and when the CMUX is used,
164+ // ^SYSTART is received in time to avoid stranger behaviour
165+ // from HW serial
166+ delay (2000 );
167+ }
168+
165169arduino::GSMClass GSM;
0 commit comments