Skip to content

Commit 6563d05

Browse files
committed
GSM: use SW flow control
1 parent b23eb10 commit 6563d05

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

libraries/GSM/src/GSM.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66
#define MAXRETRY 3
77

8+
89
mbed::CellularDevice *mbed::CellularDevice::get_default_instance()
910
{
10-
static BufferedSerial serial(MBED_CONF_GEMALTO_CINTERION_TX, MBED_CONF_GEMALTO_CINTERION_RX, 115200);
11+
static mbed::BufferedSerial serial(MBED_CONF_GEMALTO_CINTERION_TX, MBED_CONF_GEMALTO_CINTERION_RX, 115200);
1112
#if defined(MBED_CONF_GEMALTO_CINTERION_RTS) && defined(MBED_CONF_GEMALTO_CINTERION_CTS)
12-
serial.set_flow_control(mbed::SerialBase::RTSCTS, MBED_CONF_GEMALTO_CINTERION_RTS, MBED_CONF_GEMALTO_CINTERION_CTS);
13+
serial.set_flow_control(mbed::SerialBase::RTSCTS_SW, MBED_CONF_GEMALTO_CINTERION_RTS, MBED_CONF_GEMALTO_CINTERION_CTS);
1314
#endif
14-
static GEMALTO_CINTERION device(&serial);
15+
static mbed::GEMALTO_CINTERION device(&serial);
1516
return &device;
1617
}
1718

@@ -22,7 +23,6 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
2223
}
2324

2425
static mbed::DigitalOut on(PJ_7, 1);
25-
static mbed::DigitalOut rts(MBED_CONF_GEMALTO_CINTERION_RTS, 0);
2626

2727
_context->set_sim_pin(pin);
2828

@@ -39,7 +39,7 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
3939

4040
_context->set_access_technology(rat);
4141

42-
uint8_t connect_status = NSAPI_ERROR_AUTH_FAILURE;
42+
int connect_status = NSAPI_ERROR_AUTH_FAILURE;
4343
uint8_t retryCount = 0;
4444
while(connect_status != NSAPI_ERROR_OK && retryCount < MAXRETRY) {
4545

@@ -60,15 +60,15 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
6060

6161
}
6262

63-
return connect_status;
63+
return connect_status == NSAPI_ERROR_OK ? 1 : 0;
6464
}
6565

6666
void arduino::GSMClass::end() {
6767

6868
}
6969

7070
int arduino::GSMClass::disconnect() {
71-
71+
return 0;
7272
}
7373

7474
unsigned long arduino::GSMClass::getTime()

libraries/GSM/src/GSM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define MBED_CONF_GEMALTO_CINTERION_TX PA_0
3131
#define MBED_CONF_GEMALTO_CINTERION_RX PI_9
3232
#define MBED_CONF_GEMALTO_CINTERION_RTS PI_10
33-
//#define MBED_CONF_GEMALTO_CINTERION_CTS PI_13
33+
#define MBED_CONF_GEMALTO_CINTERION_CTS PI_13
3434
#define MBED_CONF_APP_SOCK_TYPE 1
3535

3636
namespace arduino {

0 commit comments

Comments
 (0)