Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
ota_update.cpp File Reference
#include "ota_update.h"
#include "ftp_stack.h"
#include "globals.h"
#include <mbedtls/sha1.h>
#include <esp_ota_ops.h>
#include <SPIFFS.h>
#include <ArduinoJson.h>
Include dependency graph for ota_update.cpp:

Macros

#define TAG   "ota_update"
 

Functions

int ota_check_for_update (ota_firmware_info_t &ota_ctx)
 
bool ota_download_update (const ota_firmware_info_t &ota_ctx)
 
bool ota_download_sdi12defn (void)
 
void back_to_factory (void)
 

Variables

static const char * wombat_sha1 = "wombat.sha1"
 
static const char * wombat_bin = "wombat.bin"
 
static constexpr size_t MAX_SDI12DEFN_SZ = 2024
 

Macro Definition Documentation

◆ TAG

#define TAG   "ota_update"

Function Documentation

◆ back_to_factory()

void back_to_factory ( void  )

◆ ota_check_for_update()

int ota_check_for_update ( ota_firmware_info_t ota_ctx)

Check if the server has a newer version of the firmware than is running on the Wombat.

Parameters
ota_ctxa reference to an OTA firmware info structure that carries info about the firmware on the server.
Returns
-1 if retrieving wombat.sha1 fails, 0 if the running version is at least as new as the version on the server, 1 if the server as a new version.

◆ ota_download_sdi12defn()

bool ota_download_sdi12defn ( void  )

◆ ota_download_update()

bool ota_download_update ( const ota_firmware_info_t ota_ctx)

Variable Documentation

◆ MAX_SDI12DEFN_SZ

constexpr size_t MAX_SDI12DEFN_SZ = 2024
staticconstexpr

◆ wombat_bin

const char* wombat_bin = "wombat.bin"
static

◆ wombat_sha1

const char* wombat_sha1 = "wombat.sha1"
static