Skip to content

Commit 2e7a2a9

Browse files
committed
GEMALTO CINTERION: fix enable cmux command
1 parent 183dd7c commit 2e7a2a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim):
5050
_context_list(0),
5151
_default_timeout(DEFAULT_AT_TIMEOUT),
5252
_modem_debug_on(false),
53+
_cmux_status(false),
5354
_property_array(NULL)
5455
{
5556
MBED_ASSERT(fh);
@@ -243,10 +244,10 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state)
243244

244245
nsapi_error_t AT_CellularDevice::enable_cmux()
245246
{
246-
setup_at_handler();
247-
247+
setup_at_handler();
248248
_at.lock();
249249
for (int retry = 1; retry <= 3; retry++) {
250+
is_ready();
250251
_at.clear_error();
251252
_at.flush();
252253
_at.at_cmd_discard("E0", "");
@@ -259,10 +260,9 @@ setup_at_handler();
259260
tr_debug("Wait 100ms to init modem");
260261
rtos::ThisThread::sleep_for(100ms); // let modem have time to get ready
261262
}
262-
return _at.unlock_return_error();
263+
return _at.unlock_return_error();
263264
}
264265

265-
266266
bool AT_CellularDevice::is_cmux_enabled()
267267
{
268268
return _cmux_status;
@@ -272,6 +272,7 @@ void AT_CellularDevice::set_cmux_status_flag(bool cmux_status)
272272
{
273273
_cmux_status = cmux_status;
274274
}
275+
275276
nsapi_error_t AT_CellularDevice::set_pin(const char *sim_pin)
276277
{
277278
// if SIM is already in ready state then settings the PIN

0 commit comments

Comments
 (0)