Skip to content

Commit 3f4a2f6

Browse files
committed
fix(mdns): Rust experimenatation
1 parent 849fe7b commit 3f4a2f6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

components/mdns/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ idf_build_get_property(target IDF_TARGET)
1414
if(${target} STREQUAL "linux")
1515
set(dependencies esp_netif_linux esp_event)
1616
set(private_dependencies esp_timer console esp_system)
17-
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
17+
set(srcs ${MDNS_NETWORKING} ${MDNS_CONSOLE})
1818
else()
1919
set(dependencies lwip console esp_netif)
2020
set(private_dependencies esp_timer esp_wifi)

components/mdns/mdns.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static inline esp_netif_t *esp_netif_from_preset_if(mdns_predef_if_t predef_if)
176176
* @param tcpip_if Ordinal number of the interface
177177
* @return Pointer ot the esp_netif object if the interface is available, NULL otherwise
178178
*/
179-
esp_netif_t *_mdns_get_esp_netif(mdns_if_t tcpip_if)
179+
esp_netif_t *_mdns_get_esp_netif23(mdns_if_t tcpip_if)
180180
{
181181
if (tcpip_if < MDNS_MAX_INTERFACES) {
182182
if (s_esp_netifs[tcpip_if].netif == NULL && s_esp_netifs[tcpip_if].predefined) {
@@ -347,7 +347,7 @@ static bool _mdns_can_add_more_services(void)
347347
return true;
348348
}
349349

350-
esp_err_t _mdns_send_rx_action(mdns_rx_packet_t *packet)
350+
esp_err_t _mdns_send_rx_action23(mdns_rx_packet_t *packet)
351351
{
352352
mdns_action_t *action = NULL;
353353

@@ -1544,6 +1544,11 @@ static void _mdns_dispatch_tx_packet(mdns_tx_packet_t *p)
15441544
mdns_debug_packet(packet, index);
15451545
#endif
15461546

1547+
ESP_LOG_BUFFER_HEXDUMP(TAG, packet, index, ESP_LOG_INFO);
1548+
for (int i = 0; i < index; ++i) {
1549+
printf("0x%02x, ", packet[i]);
1550+
}
1551+
printf("\n");
15471552
_mdns_udp_pcb_write(p->tcpip_if, p->ip_protocol, &p->dst, p->port, packet, index);
15481553
}
15491554

components/mdns/mdns_networking_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ size_t _mdns_udp_pcb_write(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, c
206206
ESP_LOGE(TAG, "espaddr_to_inet() failed: Mismatch of IP protocols");
207207
return 0;
208208
}
209-
ESP_LOGD(TAG, "[sock=%d]: Sending to IP %s port %d", sock, get_string_address(&in_addr), port);
209+
ESP_LOGI(TAG, "[sock=%d]: Sending to IP %s port %d", sock, get_string_address(&in_addr), port);
210210
ssize_t actual_len = sendto(sock, data, len, 0, (struct sockaddr *)&in_addr, ss_size);
211211
if (actual_len < 0) {
212212
ESP_LOGE(TAG, "[sock=%d]: _mdns_udp_pcb_write sendto() has failed\n errno=%d: %s", sock, errno, strerror(errno));

0 commit comments

Comments
 (0)