From 26f1d0b65978fc1204b2e084daaa39f066d3d28e Mon Sep 17 00:00:00 2001 From: mudassar-ublox Date: Fri, 14 Jun 2019 17:28:04 +0500 Subject: [PATCH] cellular socket flags updated --- .../framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp | 6 ++++++ .../targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp index ae79c339192..e1fab7e5408 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp @@ -55,6 +55,7 @@ void UBLOX_AT_CellularStack::UUSORD_URC() socket = find_socket(a); if (socket != NULL) { + socket->rx_avail = true; socket->pending_bytes = b; // No debug prints here as they can affect timing // and cause data loss in UARTSerial @@ -75,6 +76,7 @@ void UBLOX_AT_CellularStack::UUSORF_URC() socket = find_socket(a); if (socket != NULL) { + socket->rx_avail = true; socket->pending_bytes = b; // No debug prints here as they can affect timing // and cause data loss in UARTSerial @@ -151,6 +153,7 @@ nsapi_error_t UBLOX_AT_CellularStack::create_socket_impl(CellularSocket *socket) } } + socket->started = true; socket->id = sock_id; return NSAPI_ERROR_OK; @@ -383,6 +386,7 @@ nsapi_size_or_error_t UBLOX_AT_CellularStack::socket_recvfrom_impl(CellularSocke } timer.stop(); + socket->rx_avail = false; socket->pending_bytes = 0; if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) { return NSAPI_ERROR_WOULD_BLOCK; @@ -431,6 +435,8 @@ void UBLOX_AT_CellularStack::clear_socket(CellularSocket *socket) { if (socket != NULL) { socket->id = SOCKET_UNUSED; + socket->started = false; + socket->rx_avail = false; socket->pending_bytes = 0; socket->closed = true; if (socket->_cb) { diff --git a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp index dc0e0dd7934..876b8f3c1b0 100644 --- a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp +++ b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp @@ -54,6 +54,7 @@ void UBLOX_N2XX_CellularStack::NSONMI_URC() socket = find_socket(a); if (socket != NULL) { + socket->rx_avail = true; socket->pending_bytes = b; // No debug prints here as they can affect timing // and cause data loss in UARTSerial @@ -106,6 +107,7 @@ nsapi_error_t UBLOX_N2XX_CellularStack::create_socket_impl(CellularSocket *socke } } + socket->started = true; socket->id = sock_id; return NSAPI_ERROR_OK; @@ -218,6 +220,7 @@ nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_recvfrom_impl(CellularSoc } timer.stop(); + socket->rx_avail = false; socket->pending_bytes = 0; if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) { return NSAPI_ERROR_WOULD_BLOCK;