Skip to content

File espos.h

FileList > espos_core > include > espos.h

Go to the source code of this file

  • #include <stdbool.h>
  • #include "esp_err.h"

Classes

Type Name
struct espos_start_opts_t

Public Functions

Type Name
int espos_abi_version (void)
ESPOS_ABI_VERSION of the espos_core actually linked, for code compiled against another copy of the headers.
const char * espos_app_name (void)
espos_start_opts_t.app_name if one was given, else PROJECT_NAME.
const char * espos_board (void)
espos_start_opts_t.board if one was given, else NULL.
esp_err_t espos_init (void)
First half of espos_start() : the log ring and the config store, then ESPOS_EVENT_CONFIG_READY.
esp_err_t espos_start (const espos_start_opts_t * opts)
Bring everything up: log → config → [before_network] → httpd → net → [wifi] → [sk] → [ota] → [ble], the bracketed ones only if built (and, for wifi, enabled).
esp_err_t espos_start_network (void)
Second half: httpd → net → [wifi] → [sk] → [ota] → [ble].
const char * espos_version (void)
espOS's own version ("0.7.0"): the checkout's version.txt at build time, or the version the component manager installed for a registry copy.

Macros

Type Name
define ESPOS_ABI_VERSION 5
The public C ABI: every header under the components' include directories, taken together (docs/development.md, "Public API rules").
define ESPOS_START_OPTS_DEFAULT { .app\_name = NULL, .before\_network = NULL, .arg = NULL, .health\_watchdog = true, .board = NULL }

Public Functions Documentation

function espos_abi_version

ESPOS_ABI_VERSION of the espos_core actually linked, for code compiled against another copy of the headers.

int espos_abi_version (
    void
) 

Callable at any time, any task.


function espos_app_name

espos_start_opts_t.app_name if one was given, else PROJECT_NAME.

const char * espos_app_name (
    void
) 

Valid before espos_start() (the project name) and stable afterwards.


function espos_board

espos_start_opts_t.board if one was given, else NULL.

const char * espos_board (
    void
) 

A label only: espOS neither validates nor interprets it.


function espos_init

First half of espos_start() : the log ring and the config store, then ESPOS_EVENT_CONFIG_READY.

esp_err_t espos_init (
    void
) 

Idempotent; an application that initialised the store itself beforehand is fine. For code that must run between config and the network and cannot be expressed as before_network.


function espos_start

Bring everything up: log → config → [before_network] → httpd → net → [wifi] → [sk] → [ota] → [ble], the bracketed ones only if built (and, for wifi, enabled).

esp_err_t espos_start (
    const espos_start_opts_t * opts
) 

NULL = defaults. Idempotent: a second call returns ESP_OK and does nothing. On failure the components started so far stay up and the error names the stage.


function espos_start_network

Second half: httpd → net → [wifi] → [sk] → [ota] → [ble].

esp_err_t espos_start_network (
    void
) 

Requires the config store to be up (espos_init()); ESP_ERR_INVALID_STATE otherwise. Idempotent.


function espos_version

espOS's own version ("0.7.0"): the checkout's version.txt at build time, or the version the component manager installed for a registry copy.

const char * espos_version (
    void
) 

Not the application's version — that is PROJECT_VER, on the boot banner.


Macro Definition Documentation

define ESPOS_ABI_VERSION

The public C ABI: every header under the components' include directories, taken together (docs/development.md, "Public API rules").

#define ESPOS_ABI_VERSION `5`

Bumped by any change to one of them that is not purely additive — a function, type, macro or enum value removed or renamed; a signature changed; a struct's members changed in any way (appending one changes sizeof, which a caller compiled against the old header has baked in); an enum or macro value changed; a callback's threading contract changed; a new exception to the include rule. Not bumped by a new function, macro or header, or an enum value appended before its _MAX when no public struct is sized by that _MAX. A binding generated from the headers records the value it was built against and compares it with espos_abi_version() at run time.


define ESPOS_START_OPTS_DEFAULT

#define ESPOS_START_OPTS_DEFAULT `{ .app_name = NULL, .before_network = NULL, .arg = NULL, .health_watchdog = true, .board = NULL }`


The documentation for this class was generated from the following file espos_core/include/espos.h