mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-11-25 19:59:32 +01:00
Merge pull request #946 from david-cermak/fix/examples_mqtt
Add optional mqtt deps to examples
This commit is contained in:
@@ -13,10 +13,7 @@ jobs:
|
|||||||
name: Build examples
|
name: Build examples
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4"]
|
idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "release-v6.0"]
|
||||||
include:
|
|
||||||
- idf_ver: "latest"
|
|
||||||
warning: "Warning: The smallest app partition is nearly full"
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
env:
|
env:
|
||||||
@@ -27,7 +24,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Build with IDF-${{ matrix.idf_ver }}
|
- name: Build with IDF-${{ matrix.idf_ver }}
|
||||||
env:
|
env:
|
||||||
EXPECTED_WARNING: ${{ matrix.warning }}
|
EXPECTED_WARNING: "Warning: The smallest app partition is nearly full"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
. ${IDF_PATH}/export.sh
|
. ${IDF_PATH}/export.sh
|
||||||
@@ -75,7 +72,7 @@ jobs:
|
|||||||
needs: build_all_examples
|
needs: build_all_examples
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["release-v5.4", "latest"]
|
idf_ver: ["release-v5.5", "latest"]
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- modem
|
- modem
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "iface_info.h"
|
#include "iface_info.h"
|
||||||
|
#include "esp_idf_version.h"
|
||||||
|
|
||||||
static const char *TAG = "ethernet_connect";
|
static const char *TAG = "ethernet_connect";
|
||||||
|
|
||||||
@@ -109,7 +110,11 @@ iface_info_t *example_eth_init(int prio)
|
|||||||
// Use internal ESP32's ethernet
|
// Use internal ESP32's ethernet
|
||||||
eth_esp32_emac_config_t esp32_emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
|
eth_esp32_emac_config_t esp32_emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
|
||||||
eth_info->mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
|
eth_info->mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
|
||||||
|
eth_info->phy = esp_eth_phy_new_generic(&phy_config);
|
||||||
|
#else
|
||||||
eth_info->phy = esp_eth_phy_new_ip101(&phy_config);
|
eth_info->phy = esp_eth_phy_new_ip101(&phy_config);
|
||||||
|
#endif
|
||||||
// Init Ethernet driver to default and install it
|
// Init Ethernet driver to default and install it
|
||||||
esp_eth_config_t config = ETH_DEFAULT_CONFIG(eth_info->mac, eth_info->phy);
|
esp_eth_config_t config = ETH_DEFAULT_CONFIG(eth_info->mac, eth_info->phy);
|
||||||
ESP_ERROR_CHECK(esp_eth_driver_install(&config, ð_info->eth_handle));
|
ESP_ERROR_CHECK(esp_eth_driver_install(&config, ð_info->eth_handle));
|
||||||
|
|||||||
@@ -2,3 +2,7 @@ dependencies:
|
|||||||
espressif/esp_modem:
|
espressif/esp_modem:
|
||||||
version: "^1.0.0"
|
version: "^1.0.0"
|
||||||
override_path: "../../../../components/esp_modem"
|
override_path: "../../../../components/esp_modem"
|
||||||
|
espressif/mqtt:
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=6.0
|
||||||
|
version: ^1.0.0
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
# SLIP Modem Component
|
# SLIP Modem Component
|
||||||
|
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "5.3")
|
||||||
|
set(dependencies esp_driver_uart)
|
||||||
|
else()
|
||||||
|
set(dependencies driver)
|
||||||
|
endif()
|
||||||
|
|
||||||
idf_component_register(
|
idf_component_register(
|
||||||
SRCS "library/slip_modem.c" "library/slip_modem_netif.c"
|
SRCS "library/slip_modem.c" "library/slip_modem_netif.c"
|
||||||
INCLUDE_DIRS "include"
|
INCLUDE_DIRS "include"
|
||||||
REQUIRES esp_netif driver
|
REQUIRES esp_netif ${dependencies}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -53,10 +53,18 @@ esp_err_t slip_modem_netif_start(esp_netif_t *esp_netif, esp_ip6_addr_t *addr)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS)
|
||||||
|
typedef esp_err_t esp_netif_recv_ret_t;
|
||||||
|
#define ESP_NETIF_OPTIONAL_RETURN_CODE(expr) expr
|
||||||
|
#else
|
||||||
|
typedef void esp_netif_recv_ret_t;
|
||||||
|
#define ESP_NETIF_OPTIONAL_RETURN_CODE(expr)
|
||||||
|
#endif // CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write incoming serial data to the SLIP interface
|
* @brief Write incoming serial data to the SLIP interface
|
||||||
*/
|
*/
|
||||||
void esp_netif_lwip_slip_input(void *h, void *buffer, unsigned int len, void *eb)
|
esp_netif_recv_ret_t esp_netif_lwip_slip_input(void *h, void *buffer, unsigned int len, void *eb)
|
||||||
{
|
{
|
||||||
struct netif *netif = h;
|
struct netif *netif = h;
|
||||||
|
|
||||||
@@ -76,6 +84,7 @@ void esp_netif_lwip_slip_input(void *h, void *buffer, unsigned int len, void *eb
|
|||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
slipif_process_rxqueue(netif);
|
slipif_process_rxqueue(netif);
|
||||||
}
|
}
|
||||||
|
return ESP_NETIF_OPTIONAL_RETURN_CODE(ESP_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
protocol_examples_common:
|
protocol_examples_common:
|
||||||
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
|
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
|
||||||
|
espressif/mqtt:
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=6.0
|
||||||
|
version: ^1.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user