From 31bd1a795bda19cfa2ba1e8719af45b063abaad4 Mon Sep 17 00:00:00 2001 From: Ari Parkkila Date: Wed, 18 Dec 2019 01:37:53 -0800 Subject: [PATCH] Cellular: Fix Gemalto driver to handle remote peer closed --- .../CINTERION/GEMALTO_CINTERION_CellularStack.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp index e0072a7fb0..54674199d4 100644 --- a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp +++ b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp @@ -55,6 +55,17 @@ void GEMALTO_CINTERION_CellularStack::urc_sis() sock->_cb(sock->_data); } } + if (urc_code == 0) { + int urc_info_id = _at.read_int(); + if (urc_info_id == 48) { + tr_info("Socket closed %d", sock_id); + sock->closed = true; + if (sock->_cb) { + sock->_cb(sock->_data); + } + + } + } } }