drivers: modem: socket: add is_connected field to modem_socket
Let's add a field which the drivers can use to keep track of whether they are connected or not. This will normally be enabled / disabled in the socket connect and URC for socket close notify. Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
25ce3bf3eb
commit
889fc85f67
|
@ -238,6 +238,7 @@ void modem_socket_put(struct modem_socket_config *cfg, int sock_fd)
|
|||
sock->sock_fd = -1;
|
||||
sock->is_waiting = false;
|
||||
sock->is_polled = false;
|
||||
sock->is_connected = false;
|
||||
(void)memset(&sock->src, 0, sizeof(struct sockaddr));
|
||||
(void)memset(&sock->dst, 0, sizeof(struct sockaddr));
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ struct modem_socket {
|
|||
struct k_sem sem_data_ready;
|
||||
|
||||
/** socket state */
|
||||
bool is_connected;
|
||||
bool is_waiting;
|
||||
bool is_polled;
|
||||
|
||||
|
|
Loading…
Reference in a new issue