Skip to content

Commit a2c0bd8

Browse files
Jordan Yatescarlescufi
authored andcommitted
wifi: esp_at: notify receivers on async close
`esp_close_work` can be queued from the `on_cmd_closed`, which clears `ESP_SOCK_CONNECTED` and sets `ESP_SOCK_CLOSE_PENDING`, but does no further work. The receive callback should still be run with no data when the socket is closed through this mechanism. Signed-off-by: Jordan Yates <[email protected]>
1 parent 1efce43 commit a2c0bd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/wifi/esp_at/esp_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void esp_close_work(struct k_work *work)
517517
}
518518

519519
/* Should we notify that the socket has been closed? */
520-
if (old_flags & ESP_SOCK_CONNECTED) {
520+
if (old_flags & ESP_SOCK_CLOSE_PENDING) {
521521
k_mutex_lock(&sock->lock, K_FOREVER);
522522
if (sock->recv_cb) {
523523
sock->recv_cb(sock->context, NULL, NULL, NULL, 0,

0 commit comments

Comments
 (0)