![]() |
BSB Developer Docs
|
API for controlling WiFi networks. More...
#include "wifi_common.h"Go to the source code of this file.
Functions | |
| FuriState * | wifi_get_state (Wifi *instance) |
| Get the state object that supports change notifications. | |
| WifiStatus | wifi_scan (Wifi *instance, WifiScanResult *results, uint8_t *result_count, uint8_t max_result_count) |
| Scan for available Wifi access points nearby. | |
| WifiStatus | wifi_connect (Wifi *instance, const WifiCredentials *credentials, const WifiIpConfig *ip_config) |
| Connect to an access point using the specified configuration. | |
| WifiStatus | wifi_disconnect (Wifi *instance) |
| Disconnect from the access point. | |
| WifiStatus | wifi_forget (Wifi *instance) |
| Forget the currently saved network credentials. | |
| WifiStatus | wifi_get_info (Wifi *instance, WifiInfo *info) |
| Get the information about current state of the Wifi system. | |
API for controlling WiFi networks.
Some functions are blocking (will block the calling thread until completion).
Additionally, the Wifi system only serves one thread at a time, so attempting to access it from multiple threads will put them in a blocked state until the previous thread is done working with its blocking functions.
| WifiStatus wifi_connect | ( | Wifi * | instance, |
| const WifiCredentials * | credentials, | ||
| const WifiIpConfig * | ip_config ) |
Connect to an access point using the specified configuration.
This function will block the calling thread until completion.
| [in,out] | instance | pointer to the Wifi instance |
| [in] | credentials | pointer to the structure containing the connection credentials |
| [in] | ip_config | pointer to the structure containing the connection configuration |
| WifiStatus wifi_disconnect | ( | Wifi * | instance | ) |
Disconnect from the access point.
This function will block the calling thread until completion.
| [in,out] | instance | pointer to the Wifi instance |
| WifiStatus wifi_forget | ( | Wifi * | instance | ) |
Forget the currently saved network credentials.
| [in,out] | instance | pointer to the Wifi instance |
| WifiStatus wifi_get_info | ( | Wifi * | instance, |
| WifiInfo * | info ) |
Get the information about current state of the Wifi system.
This function never blocks.
| [in,out] | instance | pointer to the Wifi instance |
| [out] | info | pointer to the structure to contain the information |
| FuriState * wifi_get_state | ( | Wifi * | instance | ) |
Get the state object that supports change notifications.
The received FuriState object will have an underlying type of WifiInfo. Use furi_state_subscribe() to get notifications about changes in the current state.
This function never blocks.
| [in,out] | instance | pointer to the Wifi instance |
| WifiStatus wifi_scan | ( | Wifi * | instance, |
| WifiScanResult * | results, | ||
| uint8_t * | result_count, | ||
| uint8_t | max_result_count ) |
Scan for available Wifi access points nearby.
The array pointed to by the results parameter MUST be allocated by the user code. Naturally, it is also responsible for freeing the array when it is no longer needed.
This function will block the calling thread until completion.
| [in,out] | instance | pointer to the Wifi instance |
| [out] | results | pointer to the array to contain the scan results |
| [out] | result_count | pointer to the variable to contain the result count |
| [in] | max_result_count | maximum capacity of the scan results array |