Skip to content

File espos_wifi.h

FileList > espos_wifi > include > espos_wifi.h

Go to the source code of this file

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

Classes

Type Name
struct espos_wifi_scan_entry_t
struct espos_wifi_status_t
Snapshot of the WiFi-specific status (thread-safe copy): state machine, link, portal, counters.

Public Functions

Type Name
esp_err_t espos_wifi_get_status (espos_wifi_status_t * out)
uint32_t espos_wifi_hosted_recoveries (void)
esp_err_t espos_wifi_hosted_watchdog_start (void)
esp_err_t espos_wifi_refresh_rssi (void)
Refresh the cached RSSI from the radio.
esp_err_t espos_wifi_scan_json (char ** out_json)
JSON: {"scanning":bool,"age_s":n,"results":[{"ssid","bssid","rssi","channel","auth"}]}.
esp_err_t espos_wifi_scan_start (void)
const char * espos_wifi_short_id (void)
Deprecated: espos_net_short_id() (same value; removed in 0.9).
esp_err_t espos_wifi_start (void)
Bring up netif/event loop/driver, load the "wifi" namespace, register the HTTP endpoints and start the state machine.
esp_err_t espos_wifi_status_json (char ** out_json)
Serialise the status as the JSON document of docs/rest-api.md (malloc'ed).
esp_err_t espos_wifi_stop (void)

Public Functions Documentation

function espos_wifi_get_status

esp_err_t espos_wifi_get_status (
    espos_wifi_status_t * out
) 

function espos_wifi_hosted_recoveries

uint32_t espos_wifi_hosted_recoveries (
    void
) 

function espos_wifi_hosted_watchdog_start

esp_err_t espos_wifi_hosted_watchdog_start (
    void
) 

function espos_wifi_refresh_rssi

Refresh the cached RSSI from the radio.

esp_err_t espos_wifi_refresh_rssi (
    void
) 

MAY BLOCK. On co-processor boards (esp_hosted) this is a synchronous RPC across the host<->radio link and takes the transport timeout to fail when that link is wedged. Call it from an application task that can afford to wait — never from a UI, render or event task.

espos_wifi_get_status() deliberately does NOT do this: a status snapshot must never depend on the radio answering. Without calling this, rssi is the value captured at association, which is accurate enough for a status line and costs nothing.

ESP_ERR_NOT_SUPPORTED if the driver has no RSSI source, ESP_ERR_INVALID_STATE if not connected, ESP_FAIL if the radio did not answer.


function espos_wifi_scan_json

JSON: {"scanning":bool,"age_s":n,"results":[{"ssid","bssid","rssi","channel","auth"}]}.

esp_err_t espos_wifi_scan_json (
    char ** out_json
) 


function espos_wifi_scan_start

esp_err_t espos_wifi_scan_start (
    void
) 

function espos_wifi_short_id

Deprecated: espos_net_short_id() (same value; removed in 0.9).

const char * espos_wifi_short_id (
    void
) 

The id is the base MAC's, the same on every transport.


function espos_wifi_start

Bring up netif/event loop/driver, load the "wifi" namespace, register the HTTP endpoints and start the state machine.

esp_err_t espos_wifi_start (
    void
) 

Requires espos_config_init() and espos_httpd_start() to have run. Idempotent.


function espos_wifi_status_json

Serialise the status as the JSON document of docs/rest-api.md (malloc'ed).

esp_err_t espos_wifi_status_json (
    char ** out_json
) 


function espos_wifi_stop

esp_err_t espos_wifi_stop (
    void
) 


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