1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Fix issues on initial connection and on socket close

This commit is contained in:
Mimmo La Fauci
2012-05-23 08:34:20 +02:00
parent 5e1624a5e4
commit 917e107c72
7 changed files with 88 additions and 25 deletions

View File

@ -75,6 +75,7 @@
#define _BUFFERSIZE 100
extern void tcp_debug_print_pcbs(void);
extern bool ifStatus;
static char buf[CMD_MAX_LEN];
static char reply[REPLY_MAX_LEN];
@ -623,10 +624,17 @@ int start_server_tcp(uint16_t port, uint8_t sock)
if (_connected)
{
printk("Still connected...wait\n");
WARN("Still connected...wait\n");
return WIFI_SPI_ERR;
}
if (!ifStatus)
{
WARN("IF down...wait\n");
return WIFI_SPI_ERR;
}
if (ard_tcp_start(addr, port, NULL, NULL, mode, nbuf, buflen, udp, verbose, sock, &_ttcp) == 0)
{
INFO_SPI("Start Server [%d, %d] OK!\n", port, sock);
@ -1714,6 +1722,7 @@ int initSpi()
memset(reply, 0, sizeof(reply));
initMapSockTcp();
set_result(WL_IDLE_STATUS);
init_pBuf();