HttpsOTAUpdate.h 542 字节
Newer Older
1 2
#ifndef HTTPSOTAUPDATE_H
#define HTTPSOTAUPDATE_H
S
Sweety 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include "esp_http_client.h"
#define HttpEvent_t esp_http_client_event_t

typedef enum
{
    HTTPS_OTA_IDLE,
    HTTPS_OTA_UPDATING,
    HTTPS_OTA_SUCCESS,
    HTTPS_OTA_FAIL,
    HTTPS_OTA_ERR
}HttpsOTAStatus_t;

class HttpsOTAUpdateClass {

    public:
    void begin(const char *url, const char *cert_pem, bool skip_cert_common_name_check = true);
    void onHttpEvent(void (*http_event_cb_t)(HttpEvent_t *));
    HttpsOTAStatus_t status();
};

extern HttpsOTAUpdateClass HttpsOTA;
24
#endif