diff --git a/components/esp_netif/include/esp_netif.h b/components/esp_netif/include/esp_netif.h index 3233d4ec0..946bf1f6c 100644 --- a/components/esp_netif/include/esp_netif.h +++ b/components/esp_netif/include/esp_netif.h @@ -22,6 +22,10 @@ #include "esp_netif_types.h" #include "esp_netif_defaults.h" +#ifdef __cplusplus +extern "C" { +#endif + // // Note: tcpip_adapter legacy API has to be included by default to provide full compatibility // for applications that used tcpip_adapter API without explicit inclusion of tcpip_adapter.h @@ -736,4 +740,8 @@ size_t esp_netif_get_nr_of_ifs(void); * @} */ +#ifdef __cplusplus +} +#endif + #endif /* _ESP_NETIF_H_ */ diff --git a/components/esp_netif/include/esp_netif_defaults.h b/components/esp_netif/include/esp_netif_defaults.h index c1bc5d1e6..f2eea9d6e 100644 --- a/components/esp_netif/include/esp_netif_defaults.h +++ b/components/esp_netif/include/esp_netif_defaults.h @@ -15,6 +15,10 @@ #ifndef _ESP_NETIF_DEFAULTS_H #define _ESP_NETIF_DEFAULTS_H +#ifdef __cplusplus +extern "C" { +#endif + // // Macros to assemble master configs with partial configs from netif, stack and driver // @@ -85,4 +89,8 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config; +#ifdef __cplusplus +} +#endif + #endif //_ESP_NETIF_DEFAULTS_H diff --git a/components/esp_netif/include/esp_netif_ip_addr.h b/components/esp_netif/include/esp_netif_ip_addr.h index 620a494d2..e4b126272 100644 --- a/components/esp_netif/include/esp_netif_ip_addr.h +++ b/components/esp_netif/include/esp_netif_ip_addr.h @@ -16,6 +16,11 @@ #define _ESP_NETIF_IP_ADDR_H_ #include + +#ifdef __cplusplus +extern "C" { +#endif + #if BYTE_ORDER == BIG_ENDIAN #define esp_netif_htonl(x) ((uint32_t)(x)) #else @@ -95,4 +100,8 @@ typedef struct _ip_addr { uint8_t type; } esp_ip_addr_t; +#ifdef __cplusplus +} +#endif + #endif //_ESP_NETIF_IP_ADDR_H_ diff --git a/components/esp_netif/include/esp_netif_net_stack.h b/components/esp_netif/include/esp_netif_net_stack.h index d2a6b0f0c..8b1b2eaef 100644 --- a/components/esp_netif/include/esp_netif_net_stack.h +++ b/components/esp_netif/include/esp_netif_net_stack.h @@ -15,6 +15,10 @@ #ifndef _ESP_NETIF_NET_STACK_H_ #define _ESP_NETIF_NET_STACK_H_ +#ifdef __cplusplus +extern "C" { +#endif + // // Network stack API: This ESP-NETIF API are supposed to be called only from internals of TCP/IP stack // @@ -76,4 +80,8 @@ void esp_netif_free_rx_buffer(void *esp_netif, void* buffer); * @} */ +#ifdef __cplusplus +} +#endif + #endif //_ESP_NETIF_NET_STACK_H_ diff --git a/components/esp_netif/include/esp_netif_sta_list.h b/components/esp_netif/include/esp_netif_sta_list.h index d5bc6a690..d464132ac 100644 --- a/components/esp_netif/include/esp_netif_sta_list.h +++ b/components/esp_netif/include/esp_netif_sta_list.h @@ -17,6 +17,10 @@ #include "esp_netif_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief station list info element */ @@ -59,4 +63,9 @@ esp_err_t esp_netif_get_sta_list(const wifi_sta_list_t *wifi_sta_list, esp_netif /** * @} */ + +#ifdef __cplusplus +} +#endif + #endif //_ESP_NETIF_STA_LIST_H_ diff --git a/components/esp_netif/include/esp_netif_types.h b/components/esp_netif/include/esp_netif_types.h index 0767bae1a..05373ba5b 100644 --- a/components/esp_netif/include/esp_netif_types.h +++ b/components/esp_netif/include/esp_netif_types.h @@ -15,6 +15,10 @@ #ifndef _ESP_NETIF_TYPES_H_ #define _ESP_NETIF_TYPES_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Definition of ESP-NETIF based errors */ @@ -198,4 +202,8 @@ struct esp_netif_config { */ typedef esp_err_t (*esp_netif_receive_t)(esp_netif_t *esp_netif, void *buffer, size_t len, void *eb); +#ifdef __cplusplus +} +#endif + #endif // _ESP_NETIF_TYPES_H_ \ No newline at end of file diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 5fd82bf9c..ac6388916 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -5015,13 +5015,8 @@ void mdns_debug_packet(const uint8_t * data, size_t len) } _mdns_dbg_printf("\n"); } else if (type == MDNS_TYPE_AAAA) { -<<<<<<< HEAD - ip6_addr_t ip6; - memcpy(&ip6, data_ptr, MDNS_ANSWER_AAAA_SIZE); -======= esp_ip6_addr_t ip6; memcpy(&ip6, data_ptr, sizeof(esp_ip6_addr_t)); ->>>>>>> mdns: update mdns to use esp-netif for mdns supported services such as STA, AP, ETH _mdns_dbg_printf(IPV6STR "\n", IPV62STR(ip6)); } else if (type == MDNS_TYPE_A) { esp_ip4_addr_t ip;