forked from espressif/esp-protocols
Merge pull request #135 from mahavirj/bugfix/fix_broken_ipv4_only_build
mdns: fix IPV4 only build and also update CI configuration
This commit is contained in:
19
.github/workflows/target-test.yml
vendored
19
.github/workflows/target-test.yml
vendored
@ -56,16 +56,23 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
. ${IDF_PATH}/export.sh
|
. ${IDF_PATH}/export.sh
|
||||||
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/
|
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/
|
||||||
idf.py set-target ${{ matrix.idf_target }}
|
idf.py set-target ${{ matrix.idf_target }}
|
||||||
|
echo "Building for default configuration"
|
||||||
|
idf.py build
|
||||||
|
rm sdkconfig
|
||||||
|
echo "Building for sdkconfig.ci.eth_def"
|
||||||
cat sdkconfig.ci.eth_def >> sdkconfig.defaults
|
cat sdkconfig.ci.eth_def >> sdkconfig.defaults
|
||||||
idf.py build
|
idf.py build
|
||||||
rm sdkconfig.defaults
|
rm sdkconfig sdkconfig.defaults
|
||||||
|
echo "Building for sdkconfig.ci.eth_custom_netif"
|
||||||
cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults
|
cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults
|
||||||
idf.py build
|
idf.py build
|
||||||
rm sdkconfig.defaults
|
rm sdkconfig sdkconfig.defaults
|
||||||
|
echo "Building for sdkconfig.ci.eth_socket"
|
||||||
cat sdkconfig.ci.eth_socket >> sdkconfig.defaults
|
cat sdkconfig.ci.eth_socket >> sdkconfig.defaults
|
||||||
idf.py build
|
idf.py build
|
||||||
rm sdkconfig.defaults
|
rm sdkconfig sdkconfig.defaults
|
||||||
|
echo "Building for sdkconfig.ci.eth_no_ipv6"
|
||||||
cat sdkconfig.ci.eth_no_ipv6 >> sdkconfig.defaults
|
cat sdkconfig.ci.eth_no_ipv6 >> sdkconfig.defaults
|
||||||
idf.py build
|
idf.py build
|
||||||
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/
|
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/
|
||||||
@ -154,10 +161,8 @@ jobs:
|
|||||||
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
||||||
path: components/esp_websocket_client/examples/build/
|
path: components/esp_websocket_client/examples/build/
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
env:
|
|
||||||
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
||||||
run: |
|
run: |
|
||||||
pip install -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt
|
pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt
|
||||||
- name: Download Example Test to target
|
- name: Download Example Test to target
|
||||||
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin
|
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin
|
||||||
- name: Run Example Test on target
|
- name: Run Example Test on target
|
||||||
|
@ -396,7 +396,9 @@ static esp_netif_t *eth_start(void)
|
|||||||
#endif
|
#endif
|
||||||
#elif CONFIG_EXAMPLE_USE_SPI_ETHERNET
|
#elif CONFIG_EXAMPLE_USE_SPI_ETHERNET
|
||||||
gpio_install_isr_service(0);
|
gpio_install_isr_service(0);
|
||||||
|
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
spi_device_handle_t spi_handle = NULL;
|
spi_device_handle_t spi_handle = NULL;
|
||||||
|
#endif
|
||||||
spi_bus_config_t buscfg = {
|
spi_bus_config_t buscfg = {
|
||||||
.miso_io_num = CONFIG_EXAMPLE_ETH_SPI_MISO_GPIO,
|
.miso_io_num = CONFIG_EXAMPLE_ETH_SPI_MISO_GPIO,
|
||||||
.mosi_io_num = CONFIG_EXAMPLE_ETH_SPI_MOSI_GPIO,
|
.mosi_io_num = CONFIG_EXAMPLE_ETH_SPI_MOSI_GPIO,
|
||||||
@ -414,9 +416,14 @@ static esp_netif_t *eth_start(void)
|
|||||||
.spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO,
|
.spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO,
|
||||||
.queue_size = 20
|
.queue_size = 20
|
||||||
};
|
};
|
||||||
|
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle));
|
ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle));
|
||||||
/* dm9051 ethernet driver is based on spi driver */
|
/* dm9051 ethernet driver is based on spi driver */
|
||||||
eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(spi_handle);
|
eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(spi_handle);
|
||||||
|
#else
|
||||||
|
eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg);
|
||||||
|
#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
|
|
||||||
dm9051_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO;
|
dm9051_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO;
|
||||||
s_mac = esp_eth_mac_new_dm9051(&dm9051_config, &mac_config);
|
s_mac = esp_eth_mac_new_dm9051(&dm9051_config, &mac_config);
|
||||||
s_phy = esp_eth_phy_new_dm9051(&phy_config);
|
s_phy = esp_eth_phy_new_dm9051(&phy_config);
|
||||||
@ -429,9 +436,13 @@ static esp_netif_t *eth_start(void)
|
|||||||
.spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO,
|
.spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO,
|
||||||
.queue_size = 20
|
.queue_size = 20
|
||||||
};
|
};
|
||||||
|
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle));
|
ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle));
|
||||||
/* w5500 ethernet driver is based on spi driver */
|
/* w5500 ethernet driver is based on spi driver */
|
||||||
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(spi_handle);
|
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(spi_handle);
|
||||||
|
#else
|
||||||
|
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg);
|
||||||
|
#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||||
w5500_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO;
|
w5500_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO;
|
||||||
s_mac = esp_eth_mac_new_w5500(&w5500_config, &mac_config);
|
s_mac = esp_eth_mac_new_w5500(&w5500_config, &mac_config);
|
||||||
s_phy = esp_eth_phy_new_w5500(&phy_config);
|
s_phy = esp_eth_phy_new_w5500(&phy_config);
|
||||||
|
@ -332,10 +332,15 @@ static void query_mdns_host_with_getaddrinfo(char * host)
|
|||||||
|
|
||||||
if (!getaddrinfo(host, NULL, &hints, &res)) {
|
if (!getaddrinfo(host, NULL, &hints, &res)) {
|
||||||
while (res) {
|
while (res) {
|
||||||
ESP_LOGI(TAG, "getaddrinfo: %s resolved to: %s", host,
|
char *resolved_addr;
|
||||||
res->ai_family == AF_INET?
|
#if CONFIG_LWIP_IPV6
|
||||||
inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr):
|
resolved_addr = res->ai_family == AF_INET ?
|
||||||
inet_ntoa(((struct sockaddr_in6 *) res->ai_addr)->sin6_addr));
|
inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr) :
|
||||||
|
inet_ntoa(((struct sockaddr_in6 *) res->ai_addr)->sin6_addr);
|
||||||
|
#else
|
||||||
|
resolved_addr = inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr);
|
||||||
|
#endif // CONFIG_LWIP_IPV6
|
||||||
|
ESP_LOGI(TAG, "getaddrinfo: %s resolved to: %s", host, resolved_addr);
|
||||||
res = res->ai_next;
|
res = res->ai_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ CONFIG_MDNS_ADD_MAC_TO_HOSTNAME=y
|
|||||||
CONFIG_MDNS_PUBLISH_DELEGATE_HOST=y
|
CONFIG_MDNS_PUBLISH_DELEGATE_HOST=y
|
||||||
CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
|
CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
|
||||||
CONFIG_LWIP_IPV6=n
|
CONFIG_LWIP_IPV6=n
|
||||||
|
CONFIG_EXAMPLE_CONNECT_IPV6=n
|
||||||
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
|
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
|
||||||
CONFIG_EXAMPLE_CONNECT_WIFI=n
|
CONFIG_EXAMPLE_CONNECT_WIFI=n
|
||||||
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
|
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: "1.0.6"
|
version: "1.0.7"
|
||||||
description: mDNS
|
description: mDNS
|
||||||
dependencies:
|
dependencies:
|
||||||
idf:
|
idf:
|
||||||
|
@ -343,7 +343,7 @@ size_t _mdns_udp_pcb_write(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, c
|
|||||||
ip_add_copy.type = ip->type;
|
ip_add_copy.type = ip->type;
|
||||||
memcpy(&(ip_add_copy.u_addr), &(ip->u_addr), sizeof(ip_add_copy.u_addr));
|
memcpy(&(ip_add_copy.u_addr), &(ip->u_addr), sizeof(ip_add_copy.u_addr));
|
||||||
#else
|
#else
|
||||||
memcpy(&(ip_add_copy.addr), &(ip->u_addr), sizeof(ip_addr_copy.addr));
|
memcpy(&(ip_add_copy.addr), &(ip->u_addr), sizeof(ip_add_copy.addr));
|
||||||
#endif // CONFIG_LWIP_IPV6
|
#endif // CONFIG_LWIP_IPV6
|
||||||
|
|
||||||
mdns_api_call_t msg = {
|
mdns_api_call_t msg = {
|
||||||
|
Reference in New Issue
Block a user