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:
Michael Scott 2020-01-27 13:14:49 -08:00 committed by Jukka Rissanen
parent 25ce3bf3eb
commit 889fc85f67
2 changed files with 2 additions and 0 deletions

View file

@ -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));

View file

@ -40,6 +40,7 @@ struct modem_socket {
struct k_sem sem_data_ready;
/** socket state */
bool is_connected;
bool is_waiting;
bool is_polled;