fix esp_http_client_example to build for Linux target. Made protocol_examples_common compatible for Linux target

This commit is contained in:
Harshit Malpani
2023-02-13 10:23:16 +05:30
parent 214627f14b
commit 34705c0cc4
8 changed files with 14 additions and 20 deletions
@@ -4,7 +4,7 @@ if(${target} STREQUAL "linux")
# Header only library for linux
idf_component_register(INCLUDE_DIRS include
PRIV_REQUIRES tapif_io)
SRCS protocol_examples_utils.c)
return()
endif()
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -11,15 +11,18 @@
#include "sdkconfig.h"
#include "esp_err.h"
#if !CONFIG_IDF_TARGET_LINUX
#include "esp_netif.h"
#if CONFIG_EXAMPLE_CONNECT_ETHERNET
#include "esp_eth.h"
#endif
#endif // !CONFIG_IDF_TARGET_LINUX
#ifdef __cplusplus
extern "C" {
#endif
#if !CONFIG_IDF_TARGET_LINUX
#if CONFIG_EXAMPLE_CONNECT_WIFI
#define EXAMPLE_NETIF_DESC_STA "example_netif_sta"
#endif
@@ -96,6 +99,10 @@ void example_register_wifi_connect_commands(void);
esp_eth_handle_t get_example_eth_handle(void);
#endif // CONFIG_EXAMPLE_CONNECT_ETHERNET
#else
static inline esp_err_t example_connect(void) {return ESP_OK;}
#endif // !CONFIG_IDF_TARGET_LINUX
#ifdef __cplusplus
}
#endif