|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Request WiFi STA mode and inspect connection state. More...
Classes | |
| struct | wifi_scan_result_t |
Functions | |
| int | host_wifi_request (uint32_t timeout_ms) |
| Request the shared WiFi radio and wait up to timeout_ms for join. | |
| int | host_wifi_release (void) |
| Release the WiFi radio held by this plugin. | |
| bool | host_wifi_is_connected (void) |
| True when WiFi STA is associated and has an IP. | |
| int | host_wifi_ssid (char *out, size_t out_size) |
| Copy the currently joined SSID into out. | |
| int | host_wifi_ip (char *out, size_t out_size) |
| Copy the current IPv4 address as dotted decimal into out. | |
| int8_t | host_wifi_rssi (void) |
| Current AP signal strength in dBm. | |
| int | host_wifi_mac (uint8_t out[6]) |
| Read the station MAC address. | |
| int | host_wifi_start_scan (void) |
| Start an asynchronous WiFi scan. | |
| bool | host_wifi_scan_done (void) |
| True when the scan started by host_wifi_start_scan has finished. | |
| int | host_wifi_scan_results (wifi_scan_result_t *out, size_t *count) |
| Read results from the last completed scan. | |
Request WiFi STA mode and inspect connection state.
The WiFi radio is shared - acquire it with host_wifi_request before use and release it as early as possible. Requires manifest capability "wifi".
| int host_wifi_ip | ( | char * | out, |
| size_t | out_size ) |
Copy the current IPv4 address as dotted decimal into out.
Definition at line 63 of file host_api_wifi.cpp.
References HOST_ERR_GENERIC, HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_wifi_ip().
| bool host_wifi_is_connected | ( | void | ) |
True when WiFi STA is associated and has an IP.
Definition at line 45 of file host_api_wifi.cpp.
References cdc::ui::WifiHandlers::instance(), and cdc::ui::WifiHandlers::isConnected().
Referenced by cdc::plugin_manager::w_host_wifi_is_connected().
| int host_wifi_mac | ( | uint8_t | out[6] | ) |
Read the station MAC address.
Referenced by cdc::plugin_manager::w_host_wifi_mac().
| int host_wifi_release | ( | void | ) |
Release the WiFi radio held by this plugin.
Definition at line 39 of file host_api_wifi.cpp.
References HOST_OK, cdc::ui::WifiHandlers::instance(), and cdc::ui::WifiHandlers::release().
Referenced by cdc::plugin_manager::w_host_wifi_release().
| int host_wifi_request | ( | uint32_t | timeout_ms | ) |
Request the shared WiFi radio and wait up to timeout_ms for join.
Definition at line 34 of file host_api_wifi.cpp.
References cdc::ui::WifiHandlers::acquire(), HOST_ERR_TIMEOUT, HOST_OK, and cdc::ui::WifiHandlers::instance().
Referenced by cdc::plugin_manager::w_host_wifi_request().
| int8_t host_wifi_rssi | ( | void | ) |
Current AP signal strength in dBm.
Definition at line 71 of file host_api_wifi.cpp.
Referenced by cdc::plugin_manager::w_host_wifi_rssi().
| bool host_wifi_scan_done | ( | void | ) |
True when the scan started by host_wifi_start_scan has finished.
Definition at line 92 of file host_api_wifi.cpp.
Referenced by cdc::plugin_manager::w_host_wifi_scan_done().
| int host_wifi_scan_results | ( | wifi_scan_result_t * | out, |
| size_t * | count ) |
Read results from the last completed scan.
| count | In: capacity of out; out: number of entries written. |
Definition at line 98 of file host_api_wifi.cpp.
References wifi_scan_result_t::auth_mode, cdc::hal::WifiScanResult::channel, wifi_scan_result_t::channel, HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, cdc::hal::IWifiController::MAX_SCAN_RESULTS, cdc::hal::WifiScanResult::rssi, wifi_scan_result_t::rssi, and cdc::hal::WifiScanResult::security.
Referenced by cdc::plugin_manager::w_host_wifi_scan_results().
| int host_wifi_ssid | ( | char * | out, |
| size_t | out_size ) |
Copy the currently joined SSID into out.
Definition at line 50 of file host_api_wifi.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_wifi_ssid().
| int host_wifi_start_scan | ( | void | ) |
Start an asynchronous WiFi scan.
Definition at line 85 of file host_api_wifi.cpp.
References HOST_ERR_GENERIC, HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_wifi_start_scan().