Wi-Fi Scan and Connect API Reference#
This section provides an overview of the main APIs used for Wi-Fi scanning and connection. For full function signatures and parameters, see the WiSeConnect API reference documentation.
For detailed information on how scan and connection parameters impact Wi-Fi connection behavior and performance, see Scan and Connect Parameter Tuning.
For detailed API documentation, see the WiSeConnect API Reference – Wi-Fi.
Initialization APIs#
API | Description |
|---|---|
Initialize Wi-Fi subsystem. | |
Initialize SiWx91x subsystem |
Scan APIs#
API | Description |
|---|---|
Start a scan. Parameters: interface, optional SSID, scan configuration. Returns | |
Register callback for scan results and completion. Recommended; use instead of deprecated sl_wifi_set_scan_callback. | |
Retrieve stored results after an Extended scan. Pass structure with array and optional filters. | |
Stop an Advanced scan. Not applicable to Active, Passive, or Extended scans (they run to completion). | |
Set advanced scan configuration (channel times, trigger levels, enable_instant_scan, etc.). | |
Get current advanced scan configuration. | |
Set global timeouts (including scan channel times). Must be called before sl_wifi_init. | |
Configure individual timeout (e.g., active/passive scan channel time). Can be called after init. | |
Get the current value of a configured timeout. | |
Set scan and join transmit power (1–31 dBm). |
Channel Bitmap#
2.4 GHz:
channel_bitmap_2g4– bits 0–13 represent channels 1–14. Channel N =(1 << (N-1)).All channels: Set
channel_bitmap_2g4 = 0.Example – channels 1, 6, 11:
(1 << 0) | (1 << 5) | (1 << 10).
Connect APIs#
API | Description |
|---|---|
Connect to an AP. Performs internal scan then join. Parameters: interface, client configuration, timeout_ms. Synchronous; returns when connection attempt completes or times out. | |
Register callback for connection events (success, failure, disconnect). Required for asynchronous connect; recommended for synchronous. | |
Set join feature bitmap (BSSID-based, quick join, listen interval, MFP, etc.). | |
Set listen interval when join feature bitmap has LISTEN_INTERVAL_VALID. | |
Set retry, rejoin, and rejoin scan interval (max_retry_attempts, beacon_missed_count, scan_interval, first_time_retry_enable). | |
Set PSK credential (recommended for WPA/WPA2/WPA3). | |
Set EAP, PMK, WEP, or PSK credentials. | |
Bring interface up. | |
Check if interface is up. | |
Network-level connect using profile; internally use connection logic and internal scan. |
Callback APIs#
API | Description |
|---|---|
Invoked with scan results (up to 11 for non-Extended) and/or completion status. For Extended scan, use callback to know when scan is done, then call sl_wifi_get_stored_scan_results. | |
Register callback for connection events (success, failure, disconnect). Required for asynchronous connect; recommended for synchronous. Use |