esp8266 && 32 esp_https_ota使用Demo

本文将展示如何使用esp_https_ota库为ESP8266和ESP32设备进行HTTPS Over-The-Air (OTA)固件更新。通过这个Demo,开发者可以学习到配置服务器、连接、验证并安全地升级固件的过程。
摘要由CSDN通过智能技术生成
// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <esp_https_ota.h>
#include <esp_ota_ops.h>
#include <esp_log.h>

#define OTA_BUF_SIZE 256
static const char *TAG="ESP_HTTPS_OTA";
static void http_cleanup(esp_http_client_handle_t client)
{
   
esp_http_client_close(client);
esp_http_client_cleanup(client);
}
esp_err_t esp_https_ota(const esp_http_client_config_t *config)
{
   
	if(!config){
   
	ESP_LOGI(TAG,"esp_http_client config not found");
	return ESP_ERR_INVALID_ARG;
	}
	if(!config->cert_pem){
   
	ESP_LOGI(TAG,"Sever sertficate not found in esp_http_client config");
	return ESP_FAIL;
	}
	esp_http_clent_handle_t client=esp_http_client_init(config)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值