libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-ota.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lws_ota_ops_t
 

Macros

#define LWSOTAFIN_OK   0
 
#define LWSOTAFIN_BAD   1
 

Typedefs

typedef void * lws_ota_process_t
 
typedef void(* lws_ota_cb_t) (void *ctx, lws_ota_ret_t r)
 

Enumerations

enum  lws_ota_ret_t {
  LWSOTARET_OK , LWSOTARET_ONGOING , LWSOTARET_REJECTED , LWSOTARET_NOSLOT ,
  LWSOTARET_UPDATE_AVAILABLE , LWSOTARET_PROGRESS , LWSOTARET_FAILED , LWSOTARET_COMPLETED
}
 
enum  lws_ota_async_t { LWS_OTA_ASYNC_START = 1 , LWS_OTA_ASYNC_WRITE , LWS_OTA_ASYNC_ABORT , LWS_OTA_ASYNC_FINALIZE }
 

Functions

LWS_VISIBLE LWS_EXTERN const char * lws_ota_variant_name (void)
 
LWS_VISIBLE LWS_EXTERN int lws_plat_ota_start (struct lws_ota *g)
 
LWS_VISIBLE LWS_EXTERN void lws_plat_ota_queue (struct lws_ota *g, lws_ota_async_t a)
 
LWS_VISIBLE LWS_EXTERN int lws_plat_ota_report_current (struct lws_ota *g, int bad)
 
LWS_VISIBLE LWS_EXTERN int lws_plat_ota_get_last_fw_unixtime (uint64_t *fw_unixtime)
 

Data Structure Documentation

◆ lws_ota_ops_t

struct lws_ota_ops_t

Definition at line 66 of file lws-ota.h.

+ Collaboration diagram for lws_ota_ops_t:
Data Fields
int(*)(struct lws_ota *g) ota_start

Creates the ota task and queues LWS_OTA_ASYNC_START on it.

void(*)(struct lws_ota *g, lws_ota_async_t a) ota_queue

Queue next command to OTA task (args are in g)

int(*)(struct lws_ota *g, int bad) ota_report_current

Report information to the platform code about how we feel about the current boot... if we can check the OTA then we report it seems in good shape (bad = 0), if we can identify it's brain-damaged then (bad = 1). What action the platform takes about these reports is up to the platform code

int(*)(lws_ota_ret_t state, int percent) ota_progress

Gets called so the platform can represent OTA progress, give platform a chance to choose what to do about an available update

int(*)(uint64_t *fw_unixtime) ota_get_last_fw_unixtime

tries to recover the newest firmware unixtime that had been OTA'd into fw_unixtime, updates from same or earlier unixtime are ignored for update purposes.

int ota_periodic_check_secs

Check after this many seconds for a new update

Macro Definition Documentation

◆ LWSOTAFIN_OK

#define LWSOTAFIN_OK   0

Definition at line 112 of file lws-ota.h.

◆ LWSOTAFIN_BAD

#define LWSOTAFIN_BAD   1

Definition at line 113 of file lws-ota.h.

Typedef Documentation

◆ lws_ota_process_t

typedef void* lws_ota_process_t

Definition at line 41 of file lws-ota.h.

◆ lws_ota_cb_t

typedef void(* lws_ota_cb_t) (void *ctx, lws_ota_ret_t r)

Definition at line 64 of file lws-ota.h.

Enumeration Type Documentation

◆ lws_ota_ret_t

Enumerator
LWSOTARET_OK 
LWSOTARET_ONGOING 
LWSOTARET_REJECTED 
LWSOTARET_NOSLOT 
LWSOTARET_UPDATE_AVAILABLE 
LWSOTARET_PROGRESS 
LWSOTARET_FAILED 
LWSOTARET_COMPLETED 

Definition at line 43 of file lws-ota.h.

43 {
45 LWSOTARET_ONGOING, /* result not ready to read yet */
48
lws_ota_ret_t
Definition lws-ota.h:43
@ LWSOTARET_UPDATE_AVAILABLE
Definition lws-ota.h:49
@ LWSOTARET_REJECTED
Definition lws-ota.h:46
@ LWSOTARET_OK
Definition lws-ota.h:44
@ LWSOTARET_PROGRESS
Definition lws-ota.h:50
@ LWSOTARET_NOSLOT
Definition lws-ota.h:47
@ LWSOTARET_FAILED
Definition lws-ota.h:51
@ LWSOTARET_ONGOING
Definition lws-ota.h:45
@ LWSOTARET_COMPLETED
Definition lws-ota.h:52

◆ lws_ota_async_t

Enumerator
LWS_OTA_ASYNC_START 
LWS_OTA_ASYNC_WRITE 
LWS_OTA_ASYNC_ABORT 
LWS_OTA_ASYNC_FINALIZE 

Definition at line 55 of file lws-ota.h.

55 {
lws_ota_async_t
Definition lws-ota.h:55
@ LWS_OTA_ASYNC_START
Definition lws-ota.h:56
@ LWS_OTA_ASYNC_WRITE
Definition lws-ota.h:57
@ LWS_OTA_ASYNC_ABORT
Definition lws-ota.h:58
@ LWS_OTA_ASYNC_FINALIZE
Definition lws-ota.h:59

Function Documentation

◆ lws_ota_variant_name()

LWS_VISIBLE LWS_EXTERN const char * lws_ota_variant_name ( void )

lws_ota_variant_name() - returns the build variant name

Returns a string that uniquely identifies the kind of firmware build this device is running.

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_plat_ota_start()

LWS_VISIBLE LWS_EXTERN int lws_plat_ota_start ( struct lws_ota * g)

◆ lws_plat_ota_queue()

LWS_VISIBLE LWS_EXTERN void lws_plat_ota_queue ( struct lws_ota * g,
lws_ota_async_t a )

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_plat_ota_report_current()

LWS_VISIBLE LWS_EXTERN int lws_plat_ota_report_current ( struct lws_ota * g,
int bad )

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_plat_ota_get_last_fw_unixtime()

LWS_VISIBLE LWS_EXTERN int lws_plat_ota_get_last_fw_unixtime ( uint64_t * fw_unixtime)