14#ifndef SOTA_PROTOCOL_H
15#define SOTA_PROTOCOL_H
27#define SOTA_PATH_CHECK "/api/v1/ota/check/"
28#define SOTA_PATH_STATUS "/api/v1/ota/status/"
57 uint8_t signature[64];
73 const char *version_label,
char *out,
size_t cap);
78 const char *event, uint32_t build,
const char *reason,
79 char *out,
size_t cap);
bool sota_protocol_status_body(const char *device_id, const char *deployment, const char *event, uint32_t build, const char *reason, char *out, size_t cap)
One status event's body.
bool sota_protocol_check_body(const sota_device_info_t *dev, const sota_identity_t *live, const char *version_label, char *out, size_t cap)
The check-in body.
bool sota_protocol_check_status(const char *resp, char *out, size_t cap)
The server's "status" when no update is offered ("up_to_date", ...); false when absent.
sota_check_result_t
What a check response says.
Definition sota_protocol.h:61
@ SOTA_CHECK_MALFORMED
Offered, but url, checksum or build is unusable.
Definition sota_protocol.h:64
@ SOTA_CHECK_NO_UPDATE
update_available is false or missing.
Definition sota_protocol.h:62
@ SOTA_CHECK_OFFER
*offer holds an update.
Definition sota_protocol.h:63
sota_check_result_t sota_protocol_parse_check(const char *resp, sota_offer_t *offer)
Read a 2xx check response.
Everything a client persists, and the order it is written.
#define SOTA_VERSION_MAX
Longest version label stored.
Definition sota_state.h:49
#define SOTA_HASH_HEX_LEN
sha256 in hex.
Definition sota_state.h:51
What the device says about itself on every check-in.
Definition sota_protocol.h:32
const char * partition_profile
Partition layout name.
Definition sota_protocol.h:38
const char * labels_json
A JSON object, embedded verbatim.
Definition sota_protocol.h:41
const char * security_mode
"basic" or "signed", or NULL to report none.
Definition sota_protocol.h:40
const char * hardware_revision
Board revision.
Definition sota_protocol.h:37
const char * framework
"arduino" or "esp_idf"
Definition sota_protocol.h:34
const char * board_id
Board model.
Definition sota_protocol.h:36
const char * device_id
Stable per-unit identifier.
Definition sota_protocol.h:33
uint8_t nvs_schema_version
On-device data schema the firmware expects.
Definition sota_protocol.h:42
const char * channel
Release channel.
Definition sota_protocol.h:39
const char * chip_family
"esp32", "esp32s3", ...
Definition sota_protocol.h:35
What the device reports itself as running.
Definition sota_state.h:55
An update the server offered.
Definition sota_protocol.h:46
uint32_t size
0 when the server sent none.
Definition sota_protocol.h:54
bool signed_offer
security_mode is "signed".
Definition sota_protocol.h:55
uint32_t build
The build number SimpleOTA assigned.
Definition sota_protocol.h:53
char * url
Caller's buffer: pre-signed URLs run to 1.5 KB.
Definition sota_protocol.h:47
size_t url_cap
Size of the url buffer.
Definition sota_protocol.h:48
bool has_signature
signature decoded to 64 ed25519 bytes.
Definition sota_protocol.h:56