drivers: wifi: eswifi: Stop client before starting

Stop any TCP/UDP client session before starting a new one.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This commit is contained in:
Loic Poulain 2020-07-07 17:24:32 +02:00 committed by Jukka Rissanen
commit 0a1de7e96a

View file

@ -160,6 +160,10 @@ int __eswifi_off_start_client(struct eswifi_dev *eswifi,
__select_socket(eswifi, socket->index); __select_socket(eswifi, socket->index);
/* Stop any running client */
snprintk(eswifi->buf, sizeof(eswifi->buf), "P6=0\r");
eswifi_at_cmd(eswifi, eswifi->buf);
/* Set Remote IP */ /* Set Remote IP */
snprintk(eswifi->buf, sizeof(eswifi->buf), "P3=%u.%u.%u.%u\r", snprintk(eswifi->buf, sizeof(eswifi->buf), "P3=%u.%u.%u.%u\r",
sin_addr->s4_addr[0], sin_addr->s4_addr[1], sin_addr->s4_addr[0], sin_addr->s4_addr[1],