mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_sc_send_failure_and_exit_issue' into 'master'
smartconfig: fix the issue of sending failure and exit Closes WIFI-3844 See merge request espressif/esp-idf!22604
This commit is contained in:
commit
d4a358a115
@ -90,6 +90,7 @@ static void sc_ack_send_task(void *pvParameters)
|
||||
port_bit = 0;
|
||||
}
|
||||
remote_port = SC_ACK_TOUCH_V2_SERVER_PORT(port_bit);
|
||||
memset(remote_ip, 0xFF, sizeof(remote_ip));
|
||||
} else {
|
||||
remote_port = SC_ACK_AIRKISS_SERVER_PORT;
|
||||
}
|
||||
@ -163,15 +164,24 @@ static void sc_ack_send_task(void *pvParameters)
|
||||
memcpy(remote_ip, &from.sin_addr, 4);
|
||||
server_addr.sin_addr.s_addr = from.sin_addr.s_addr;
|
||||
} else {
|
||||
goto _end;
|
||||
server_addr.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ip_addr = server_addr.sin_addr.s_addr;
|
||||
while (s_sc_ack_send) {
|
||||
/* Send smartconfig ACK every 100ms. */
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
if (ip_addr != INADDR_BROADCAST) {
|
||||
sendto(send_sock, &ack->ctx, ack_len, 0, (struct sockaddr*) &server_addr, sin_size);
|
||||
server_addr.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
sendlen = sendto(send_sock, &ack->ctx, ack_len, 0, (struct sockaddr*) &server_addr, sin_size);
|
||||
server_addr.sin_addr.s_addr = ip_addr;
|
||||
} else {
|
||||
sendlen = sendto(send_sock, &ack->ctx, ack_len, 0, (struct sockaddr*) &server_addr, sin_size);
|
||||
}
|
||||
|
||||
if (sendlen <= 0) {
|
||||
err = sc_ack_send_get_errno(send_sock);
|
||||
ESP_LOGD(TAG, "send failed, errno %d", err);
|
||||
|
Loading…
Reference in New Issue
Block a user