Skip to content

Commit b8f413a

Browse files
authored
Merge pull request #10811 from u-blox/ubx_socket_close_callback
socket close callback
2 parents 5b0f45f + 3ad1ee1 commit b8f413a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,12 @@ UBLOX_AT_CellularStack::CellularSocket *UBLOX_AT_CellularStack::find_socket(int
430430
void UBLOX_AT_CellularStack::clear_socket(CellularSocket *socket)
431431
{
432432
if (socket != NULL) {
433-
socket->id = SOCKET_UNUSED;
433+
socket->id = SOCKET_UNUSED;
434434
socket->pending_bytes = 0;
435-
socket->_cb = NULL;
436-
socket->_data = NULL;
435+
socket->closed = true;
436+
if (socket->_cb) {
437+
socket->_cb(socket->_data);
438+
}
437439
}
438440
}
439441

0 commit comments

Comments
 (0)