modem: hl7800: only send null packet for TCP

Only TCP sockets should send a NULL packet
if the server closes the connection or there
is a socket error.
UDP sockets do not need to do this because
they are connectionless.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
Ryan Erickson 2022-02-03 16:53:35 -06:00 committed by Carles Cufí
parent 208927d640
commit a9eead1824

View file

@ -3506,11 +3506,13 @@ static void sock_notif_cb_work(struct k_work *work)
k_work_reschedule_for_queue(&hl7800_workq, &sock->notif_work,
MDM_SOCK_NOTIF_DELAY);
} else {
if (sock->type == SOCK_STREAM) {
LOG_DBG("Sock %d trigger NULL packet", sock->socket_id);
sock->state = SOCK_SERVER_CLOSED;
k_work_submit_to_queue(&hl7800_workq, &sock->recv_cb_work);
sock->error = false;
}
}
hl7800_unlock();
}