Update esp_http_client example to build for linux target

This commit is contained in:
Harshit Malpani
2022-11-08 16:31:52 +05:30
parent e215ede439
commit 5c728e94a7
9 changed files with 141 additions and 36 deletions

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS esp_stubs.c
INCLUDE_DIRS "include")

View 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;
}

View File

@@ -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);

View 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);

View 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);

View File

@@ -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);