From b937de7df28cda0b82567ded5ee884102f045b3b Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 11 Sep 2019 11:50:58 +0800 Subject: [PATCH] fix the bug that ESP32 sends broadcast to phone after smartconfig is done --- components/smartconfig_ack/smartconfig_ack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/smartconfig_ack/smartconfig_ack.c b/components/smartconfig_ack/smartconfig_ack.c index f84aad367..746535d80 100644 --- a/components/smartconfig_ack/smartconfig_ack.c +++ b/components/smartconfig_ack/smartconfig_ack.c @@ -61,7 +61,7 @@ static void sc_ack_send_task(void *pvParameters) bzero(&server_addr, sizeof(struct sockaddr_in)); server_addr.sin_family = AF_INET; - server_addr.sin_addr.s_addr = inet_addr((const char*)remote_ip); + memcpy(&server_addr.sin_addr.s_addr, remote_ip, sizeof(remote_ip)); server_addr.sin_port = htons(remote_port); esp_wifi_get_mac(WIFI_IF_STA, ack->ctx.mac);