mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Update esp_http_client example to build for linux target
This commit is contained in:
2
examples/protocols/linux_stubs/esp_stubs/CMakeLists.txt
Normal file
2
examples/protocols/linux_stubs/esp_stubs/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS esp_stubs.c
|
||||
INCLUDE_DIRS "include")
|
42
examples/protocols/linux_stubs/esp_stubs/esp_stubs.c
Normal file
42
examples/protocols/linux_stubs/esp_stubs/esp_stubs.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
extern void app_main(void);
|
||||
|
||||
esp_err_t esp_event_loop_create_default(void)
|
||||
{
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_netif_init(void)
|
||||
{
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t example_connect(void)
|
||||
{
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t nvs_flash_init(void)
|
||||
{
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t nvs_flash_erase(void)
|
||||
{
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
app_main();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include "esp_err.h"
|
||||
|
||||
esp_err_t esp_event_loop_create_default(void);
|
11
examples/protocols/linux_stubs/esp_stubs/include/esp_netif.h
Normal file
11
examples/protocols/linux_stubs/esp_stubs/include/esp_netif.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <ifaddrs.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
esp_err_t esp_netif_init(void);
|
14
examples/protocols/linux_stubs/esp_stubs/include/nvs_flash.h
Normal file
14
examples/protocols/linux_stubs/esp_stubs/include/nvs_flash.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include "esp_err.h"
|
||||
|
||||
#define ESP_ERR_NVS_BASE 0x1100 /*!< Starting number of error codes */
|
||||
#define ESP_ERR_NVS_NO_FREE_PAGES (ESP_ERR_NVS_BASE + 0x0d) /*!< NVS partition doesn't contain any empty pages. This may happen if NVS partition was truncated. Erase the whole partition and call nvs_flash_init again. */
|
||||
#define ESP_ERR_NVS_NEW_VERSION_FOUND (ESP_ERR_NVS_BASE + 0x10) /*!< NVS partition contains data in new format and cannot be recognized by this version of code */
|
||||
|
||||
esp_err_t nvs_flash_init(void);
|
||||
|
||||
esp_err_t nvs_flash_erase(void);
|
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include "esp_err.h"
|
||||
|
||||
esp_err_t example_connect(void);
|
Reference in New Issue
Block a user