mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-05 16:32:34 +00:00
udp_multicast example: Change port to 3333 to match README, log port from example
This commit is contained in:
committed by
Angus Gratton
parent
5fb665dbaf
commit
bf665ae62e
@@ -499,11 +499,11 @@ static void mcast_example_task(void *pvParameters)
|
||||
#ifdef CONFIG_EXAMPLE_IPV4_ONLY
|
||||
((struct sockaddr_in *)res->ai_addr)->sin_port = htons(UDP_PORT);
|
||||
inet_ntoa_r(((struct sockaddr_in *)res->ai_addr)->sin_addr, addrbuf, sizeof(addrbuf)-1);
|
||||
ESP_LOGI(TAG, "Sending to IPV4 multicast address %s...", addrbuf);
|
||||
ESP_LOGI(TAG, "Sending to IPV4 multicast address %s:%d...", addrbuf, UDP_PORT);
|
||||
#else
|
||||
((struct sockaddr_in6 *)res->ai_addr)->sin6_port = htons(UDP_PORT);
|
||||
inet6_ntoa_r(((struct sockaddr_in6 *)res->ai_addr)->sin6_addr, addrbuf, sizeof(addrbuf)-1);
|
||||
ESP_LOGI(TAG, "Sending to IPV6 (V4 mapped) multicast address %s (%s)...", addrbuf, CONFIG_EXAMPLE_MULTICAST_IPV4_ADDR);
|
||||
ESP_LOGI(TAG, "Sending to IPV6 (V4 mapped) multicast address %s port %d (%s)...", addrbuf, UDP_PORT, CONFIG_EXAMPLE_MULTICAST_IPV4_ADDR);
|
||||
#endif
|
||||
err = sendto(sock, sendbuf, len, 0, res->ai_addr, res->ai_addrlen);
|
||||
freeaddrinfo(res);
|
||||
@@ -527,7 +527,7 @@ static void mcast_example_task(void *pvParameters)
|
||||
struct sockaddr_in6 *s6addr = (struct sockaddr_in6 *)res->ai_addr;
|
||||
s6addr->sin6_port = htons(UDP_PORT);
|
||||
inet6_ntoa_r(s6addr->sin6_addr, addrbuf, sizeof(addrbuf)-1);
|
||||
ESP_LOGI(TAG, "Sending to IPV6 multicast address %s...", addrbuf);
|
||||
ESP_LOGI(TAG, "Sending to IPV6 multicast address %s port %d...", addrbuf, UDP_PORT);
|
||||
err = sendto(sock, sendbuf, len, 0, res->ai_addr, res->ai_addrlen);
|
||||
freeaddrinfo(res);
|
||||
if (err < 0) {
|
||||
|
||||
Reference in New Issue
Block a user