Skip to content

Commit 26f1d0b

Browse files
cellular socket flags updated
1 parent bf78dc4 commit 26f1d0b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void UBLOX_AT_CellularStack::UUSORD_URC()
5555

5656
socket = find_socket(a);
5757
if (socket != NULL) {
58+
socket->rx_avail = true;
5859
socket->pending_bytes = b;
5960
// No debug prints here as they can affect timing
6061
// and cause data loss in UARTSerial
@@ -75,6 +76,7 @@ void UBLOX_AT_CellularStack::UUSORF_URC()
7576

7677
socket = find_socket(a);
7778
if (socket != NULL) {
79+
socket->rx_avail = true;
7880
socket->pending_bytes = b;
7981
// No debug prints here as they can affect timing
8082
// and cause data loss in UARTSerial
@@ -151,6 +153,7 @@ nsapi_error_t UBLOX_AT_CellularStack::create_socket_impl(CellularSocket *socket)
151153
}
152154
}
153155

156+
socket->started = true;
154157
socket->id = sock_id;
155158

156159
return NSAPI_ERROR_OK;
@@ -383,6 +386,7 @@ nsapi_size_or_error_t UBLOX_AT_CellularStack::socket_recvfrom_impl(CellularSocke
383386
}
384387
timer.stop();
385388

389+
socket->rx_avail = false;
386390
socket->pending_bytes = 0;
387391
if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) {
388392
return NSAPI_ERROR_WOULD_BLOCK;
@@ -431,6 +435,8 @@ void UBLOX_AT_CellularStack::clear_socket(CellularSocket *socket)
431435
{
432436
if (socket != NULL) {
433437
socket->id = SOCKET_UNUSED;
438+
socket->started = false;
439+
socket->rx_avail = false;
434440
socket->pending_bytes = 0;
435441
socket->closed = true;
436442
if (socket->_cb) {

features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void UBLOX_N2XX_CellularStack::NSONMI_URC()
5454

5555
socket = find_socket(a);
5656
if (socket != NULL) {
57+
socket->rx_avail = true;
5758
socket->pending_bytes = b;
5859
// No debug prints here as they can affect timing
5960
// and cause data loss in UARTSerial
@@ -106,6 +107,7 @@ nsapi_error_t UBLOX_N2XX_CellularStack::create_socket_impl(CellularSocket *socke
106107
}
107108
}
108109

110+
socket->started = true;
109111
socket->id = sock_id;
110112

111113
return NSAPI_ERROR_OK;
@@ -218,6 +220,7 @@ nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_recvfrom_impl(CellularSoc
218220
}
219221
timer.stop();
220222

223+
socket->rx_avail = false;
221224
socket->pending_bytes = 0;
222225
if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) {
223226
return NSAPI_ERROR_WOULD_BLOCK;

0 commit comments

Comments
 (0)