Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
Macros | Functions
esp_wireless_handler.h File Reference
#include "esp_err.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_netif.h"
#include "esp_now.h"
#include "esp_wifi.h"
#include "general/message_protocol.h"
#include "lwip/ip_addr.h"
#include "master/main_master.h"
#include "nvs_flash.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <string.h>
Include dependency graph for esp_wireless_handler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MODULE_TAG   "ACCESS POINT"
 
#define MIN_WPA2_PW_LEN   8u
 

Functions

void start_espnow_at_boot (void)
 Start ESP-NOW at boot (STA or default wireless mode)
 
int switch_back_to_espnow_only (void)
 Switch back from AP/APSTA to ESP-NOW-only mode.
 
int switch_to_ap_mode_keep_espnow (const char *ssid, const char *pw, uint8_t channel, const char *ip_str)
 Switch to AP or APSTA mode while keeping ESP-NOW.
 

Macro Definition Documentation

◆ MIN_WPA2_PW_LEN

#define MIN_WPA2_PW_LEN   8u

◆ MODULE_TAG

#define MODULE_TAG   "ACCESS POINT"

Function Documentation

◆ start_espnow_at_boot()

void start_espnow_at_boot ( void  )

Start ESP-NOW at boot (STA or default wireless mode)

Initializes WiFi/NVS and configures ESP-NOW for slave discovery and messaging. Call once at master startup.

◆ switch_back_to_espnow_only()

int switch_back_to_espnow_only ( void  )

Switch back from AP/APSTA to ESP-NOW-only mode.

Disables AP and keeps ESP-NOW running.

Returns
ESP_OK on success, error code otherwise

◆ switch_to_ap_mode_keep_espnow()

int switch_to_ap_mode_keep_espnow ( const char *  ssid,
const char *  pw,
uint8_t  channel,
const char *  ip_str 
)

Switch to AP or APSTA mode while keeping ESP-NOW.

Enables an access point with the given SSID/password for config UI; ESP-NOW continues to work.

Parameters
ssidAP SSID
pwAP password (min MIN_WPA2_PW_LEN chars)
channelWiFi channel (e.g. 1)
ip_strOptional IP string for AP (can be NULL for default)
Returns
ESP_OK on success, error code otherwise