Login to WiFi using Zephyr's wifi_mgmt / net_mgmt API. Access via the global object ZEPHYR_WIFI.
More...
#include <WiFiZephyr.h>
|
| bool | setupWIFI (const char *ssid, const char *password) |
| |
|
| static void | ip_event_handler (struct net_mgmt_event_callback *cb, uint64_t mgmt_event, struct net_if *iface) |
| |
| static void | wifi_event_handler (struct net_mgmt_event_callback *cb, uint64_t mgmt_event, struct net_if *iface) |
| |
Login to WiFi using Zephyr's wifi_mgmt / net_mgmt API. Access via the global object ZEPHYR_WIFI.
- Note
- the following settings need to be active: CONFIG_NETWORKING=y CONFIG_NET_L2_WIFI_MGMT=y CONFIG_WIFI=y CONFIG_NET_DHCPV4=y
- Author
- Phil Schatzmann (ported to Zephyr)
- Copyright
- GPLv3
◆ begin()
| bool begin |
( |
const char * |
ssid, |
|
|
const char * |
password |
|
) |
| |
|
inline |
◆ end()
◆ ip()
| const struct in_addr & ip |
( |
| ) |
const |
|
inline |
Returns the assigned IPv4 address (valid after isConnected() == true).
◆ ip_event_handler()
| static void ip_event_handler |
( |
struct net_mgmt_event_callback * |
cb, |
|
|
uint64_t |
mgmt_event, |
|
|
struct net_if * |
iface |
|
) |
| |
|
inlinestaticprotected |
Handles NET_EVENT_IPV4_ADDR_ADD (equivalent to IP_EVENT_STA_GOT_IP).
◆ isConnected()
◆ localIP()
◆ setPowerSave()
| void setPowerSave |
( |
enum wifi_ps |
mode | ) |
|
|
inline |
Power-save mode — maps to Zephyr's WIFI_PS_* values: WIFI_PS_DISABLED (= WIFI_PS_NONE equivalent) WIFI_PS_ENABLED
◆ setupWIFI()
| bool setupWIFI |
( |
const char * |
ssid, |
|
|
const char * |
password |
|
) |
| |
|
inlineprotected |
◆ status()
◆ wifi_event_handler()
| static void wifi_event_handler |
( |
struct net_mgmt_event_callback * |
cb, |
|
|
uint64_t |
mgmt_event, |
|
|
struct net_if * |
iface |
|
) |
| |
|
inlinestaticprotected |
Handles WIFI_CONNECT_RESULT and WIFI_DISCONNECT_RESULT.
◆ _instance
◆ _ip
◆ _ip_cb
| struct net_mgmt_event_callback _ip_cb |
|
protected |
◆ _is_open
| volatile bool _is_open = false |
|
protected |
◆ _power_save
| enum wifi_ps _power_save = WIFI_PS_DISABLED |
|
protected |
◆ _wifi_cb
| struct net_mgmt_event_callback _wifi_cb |
|
protected |
The documentation for this class was generated from the following file: