From 5202be013a47312c0c77b171a0e5c4be4d2ab55c Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 16 Jan 2020 11:54:02 +0800 Subject: [PATCH] fix the bug for Airkiss --- components/esp_wifi/src/smartconfig_ack.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/src/smartconfig_ack.c b/components/esp_wifi/src/smartconfig_ack.c index 3cda1a21c..2a08ff531 100644 --- a/components/esp_wifi/src/smartconfig_ack.c +++ b/components/esp_wifi/src/smartconfig_ack.c @@ -71,7 +71,12 @@ static void sc_ack_send_task(void *pvParameters) sc_ack_t *ack = (sc_ack_t *)pvParameters; tcpip_adapter_ip_info_t local_ip; uint8_t remote_ip[4]; - memcpy(remote_ip, ack->ctx.ip, sizeof(remote_ip)); + if (ack->type == SC_TYPE_ESPTOUCH) { + memcpy(remote_ip, ack->ctx.ip, sizeof(remote_ip)); + } else { + memset(remote_ip, 255, 4); + } + int remote_port = (ack->type == SC_TYPE_ESPTOUCH) ? SC_ACK_TOUCH_SERVER_PORT : SC_ACK_AIRKISS_SERVER_PORT; struct sockaddr_in server_addr; socklen_t sin_size = sizeof(server_addr);