Wi-Fi ready
The Wi-Fi ready library manages Wi-Fi® readiness for applications by handling supplicant ready and not ready events.
Overview
The Wi-Fi ready library informs applications of Wi-Fi readiness by managing supplicant events, indicating when Wi-Fi is available for use.
Configuration
To use this library, enable the CONFIG_WIFI_READY_LIB
Kconfig option.
API documentation
include/net/wifi_ready.h
subsys/net/lib/wifi_ready
- group wifi_ready
Library for handling Wi-Fi ready events.
Functions
-
int register_wifi_ready_callback(wifi_ready_callback_t cb, struct net_if *iface)
Register a callback to be called when the Wi-Fi is ready.
- Parameters:
cb – Callback function to be called when the Wi-Fi is ready. The callback is called from NET_MGMT thread, so, care should be taken to avoid blocking the thread and also stack size should be considered.
iface – (optional) Interface to which the callback is registered.
- Return values:
-EINVAL – if the callback is NULL.
-ENOMEM – if the callback array is full.
-EALREADY – if the callback is already registered.
- Returns:
0 if the callback was successfully registered, or a negative error code if the callback could not be registered.
-
int unregister_wifi_ready_callback(wifi_ready_callback_t cb, struct net_if *iface)
Unregister a callback that was registered to be called when the Wi-Fi is ready.
- Parameters:
cb – Callback function to be unregistered.
iface – (optional) Interface to which the callback is registered.
- Return values:
-EINVAL – if the callback is NULL.
-ENOENT – if the callback is not registered.
- Returns:
0 if the callback was successfully unregistered, or a negative error code if the callback could not be unregistered.
-
struct wifi_ready_callback_t
- #include <wifi_ready.h>
Structure for storing a callback function to be called when the Wi-Fi is ready.
-
int register_wifi_ready_callback(wifi_ready_callback_t cb, struct net_if *iface)