![]() |
Morse Micro IoT SDK
2.10.4
|
API for configuration and control of Station (STA) mode.
Modules | |
| [Deprecated] WLAN offload features | |
| WLAN offload features enable offloading some high level networking features to the WLAN chip. | |
| [Deprecated] WLAN Standby features | |
| The standby mode allows the system to power off or put the host processor in a deep sleep mode while the Morse chip takes over certain functionality to keep the connection alive with the provision to wake up the host processor when certain conditions are met. | |
| WNM Sleep management | |
Data Structures | |
| struct | mmwlan_sta_event_cb_args |
| Argument passed to the STA event callback. More... | |
| struct | mmwlan_sta_args |
| Arguments data structure for mmwlan_sta_enable(). More... | |
| struct | mmwlan_twt_config_args |
| Structure for storing Target Wake Time (TWT) configuration arguments. More... | |
Macros | |
| #define | DEFAULT_BGSCAN_SHORT_INTERVAL_S (0) |
| Default Background scan short interval in seconds. More... | |
| #define | DEFAULT_BGSCAN_THRESHOLD_DBM (0) |
| Default Background scan signal threshold in dBm. More... | |
| #define | DEFAULT_BGSCAN_LONG_INTERVAL_S (0) |
| Default Background scan long interval in seconds. More... | |
| #define | DEFAULT_TWT_WAKE_INTERVAL_US (300000000) |
| Default Target Wake Time (TWT) interval in micro seconds. More... | |
| #define | DEFAULT_TWT_MIN_WAKE_DURATION_US (65280) |
| Default min Target Wake Time (TWT) duration in micro seconds. More... | |
| #define | MMWLAN_DEFAULT_SCAN_INTERVAL_BASE_S (2) |
Default value for the scan_interval_base_s field of mmwlan_sta_args. More... | |
| #define | MMWLAN_DEFAULT_SCAN_INTERVAL_LIMIT_S (512) |
Default value for the scan_interval_limit_s field of mmwlan_sta_args. More... | |
| #define | MMWLAN_RAW_MAX_PRIORITY (7) |
| Maximum allowable Restricted Access Window (RAW) priority for STA. More... | |
| #define | MMWLAN_STA_ARGS_INIT |
| Initializer for mmwlan_sta_args. More... | |
| #define | MMWLAN_DEFAULT_DYNAMIC_PS_TIMEOUT_MS 100; |
| Default timeout after network activity to signal sleep. More... | |
| #define | MMWLAN_TWT_CONFIG_ARGS_INIT |
| Initializer for mmwlan_twt_config_args. More... | |
Typedefs | |
| typedef void(* | mmwlan_sta_status_cb_t) (enum mmwlan_sta_state sta_state) |
| STA status callback function prototype. More... | |
| typedef void(* | mmwlan_sta_event_cb_t) (const struct mmwlan_sta_event_cb_args *sta_event, void *arg) |
| STA event callback prototype. More... | |
Functions | |
| enum mmwlan_status | mmwlan_sta_enable (const struct mmwlan_sta_args *args, mmwlan_sta_status_cb_t sta_status_cb) |
| Enable station mode. More... | |
| enum mmwlan_status | mmwlan_sta_disable (void) |
| Disable station mode. More... | |
| enum mmwlan_sta_state | mmwlan_get_sta_state (void) |
| Gets the current WLAN STA state. More... | |
| enum mmwlan_status | mmwlan_set_power_save_mode (enum mmwlan_ps_mode mode) |
| Sets whether or not the 802.11 power save is enabled. More... | |
| enum mmwlan_status | mmwlan_set_dynamic_ps_timeout (uint32_t timeout_ms) |
| Sets the time after network activity before the STA will notify the AP that it will go to sleep using a QoS Null frame and when the host will release its veto (via the wake pin) on chip sleep. More... | |
| enum mmwlan_status | mmwlan_set_non_tim_mode_enabled (bool non_tim_mode_enabled) |
| Sets whether or not non-TIM mode support is enabled. More... | |
| enum mmwlan_status | mmwlan_twt_add_configuration (const struct mmwlan_twt_config_args *twt_config_args) |
| Add configurations for Target Wake Time (TWT). More... | |
| uint16_t | mmwlan_get_aid (void) |
| Gets the station's AID. More... | |
| enum mmwlan_status | mmwlan_get_bssid (uint8_t *bssid) |
| Gets the BSSID of the AP to which the STA is associated. More... | |
| int32_t | mmwlan_get_rssi (void) |
| Gets the RSSI measured from the AP. More... | |
| enum mmwlan_status | mmwlan_set_listen_interval (uint16_t interval) |
| Sets the listen interval to be indicated in the association response frame. More... | |
| #define DEFAULT_BGSCAN_LONG_INTERVAL_S (0) |
| #define DEFAULT_BGSCAN_SHORT_INTERVAL_S (0) |
| #define DEFAULT_BGSCAN_THRESHOLD_DBM (0) |
| #define DEFAULT_TWT_MIN_WAKE_DURATION_US (65280) |
| #define DEFAULT_TWT_WAKE_INTERVAL_US (300000000) |
| #define MMWLAN_DEFAULT_DYNAMIC_PS_TIMEOUT_MS 100; |
| #define MMWLAN_DEFAULT_SCAN_INTERVAL_BASE_S (2) |
Default value for the scan_interval_base_s field of mmwlan_sta_args.
| #define MMWLAN_DEFAULT_SCAN_INTERVAL_LIMIT_S (512) |
Default value for the scan_interval_limit_s field of mmwlan_sta_args.
| #define MMWLAN_RAW_MAX_PRIORITY (7) |
| #define MMWLAN_STA_ARGS_INIT |
Initializer for mmwlan_sta_args.
| #define MMWLAN_TWT_CONFIG_ARGS_INIT |
Initializer for mmwlan_twt_config_args.
For example:
| typedef void(* mmwlan_sta_event_cb_t) (const struct mmwlan_sta_event_cb_args *sta_event, void *arg) |
| typedef void(* mmwlan_sta_status_cb_t) (enum mmwlan_sta_state sta_state) |
| enum mmwlan_4addr_mode |
| enum mmwlan_cac_mode |
| enum mmwlan_ps_mode |
| enum mmwlan_sta_event |
Enumeration of STA events.
| enum mmwlan_sta_state |
| enum mmwlan_station_type |
| enum mmwlan_twt_mode |
| uint16_t mmwlan_get_aid | ( | void | ) |
Gets the station's AID.
| enum mmwlan_status mmwlan_get_bssid | ( | uint8_t * | bssid | ) |
Gets the BSSID of the AP to which the STA is associated.
| bssid | Buffer to receive the BSSID. Length must be MMWLAN_MAC_ADDR_LEN. Will only be set if MMWLAN_SUCCESS is returned. |
| int32_t mmwlan_get_rssi | ( | void | ) |
Gets the RSSI measured from the AP.
When power save is enabled, this will only be updated when traffic is received from the AP.
| enum mmwlan_sta_state mmwlan_get_sta_state | ( | void | ) |
Gets the current WLAN STA state.
| enum mmwlan_status mmwlan_set_dynamic_ps_timeout | ( | uint32_t | timeout_ms | ) |
Sets the time after network activity before the STA will notify the AP that it will go to sleep using a QoS Null frame and when the host will release its veto (via the wake pin) on chip sleep.
network traffic QoS Null
|----------------------------------------| |
+--------------------------------------------------------+
Wake Pin | | --------—+ +------— |------------—| dynamic_ps_timeout_ms |------— sleep permitted
| timeout_ms | Timeout after network activity before signaling sleep. |
| enum mmwlan_status mmwlan_set_listen_interval | ( | uint16_t | interval | ) |
Sets the listen interval to be indicated in the association response frame.
This informs the AP how often the STA will wake up. The AP uses the listen interval in determining the lifetime of frames that it buffers for a STA.
| [in] | interval | Interval value in beacon or short beacon units. e.g. 5 will set the listen interval to the interval between 5 beacons. 0 will disable this feature. |
MMWLAN_SUCCESS on success, else an appropriate error code. | enum mmwlan_status mmwlan_set_non_tim_mode_enabled | ( | bool | non_tim_mode_enabled | ) |
Sets whether or not non-TIM mode support is enabled.
Upon successful non-TIM mode negotiation, the STA will ignore traffic indication map (TIM) and send PS-Poll every listen interval. This defaults to disabled and is for STA mode only.
| non_tim_mode_enabled | Boolean value indicating whether non-TIM mode support should be enabled. |
| enum mmwlan_status mmwlan_set_power_save_mode | ( | enum mmwlan_ps_mode | mode | ) |
Sets whether or not the 802.11 power save is enabled.
Defaults to MMWLAN_PS_ENABLED
| mode | enum indicating which 802.11 power save mode to use. |
| enum mmwlan_status mmwlan_sta_disable | ( | void | ) |
Disable station mode.
This will disconnect from the AP. It will also shut down the transceiver if nothing else is holding it open. Note that if the transceiver was booted by mmwlan_boot() then this function will not shut down the transceiver.
| enum mmwlan_status mmwlan_sta_enable | ( | const struct mmwlan_sta_args * | args, |
| mmwlan_sta_status_cb_t | sta_status_cb | ||
| ) |
Enable station mode.
This will power on the transceiver then initiate connection to the given Access Point. If station mode is already enabled when this function is invoked then it will disconnect from (if already connected) and initiate connection to the given AP.
sta_status_cb) must not block and MMWLAN API functions may not be invoked from the callback. args->extra_assoc_ies buffer will be made if args->extra_assoc_ies_len is non-zero. Caller is responsible for freeing the buffer in args after this function is called.sta_status_cb parameter should not be used. Please use mmwlan_sta_args.ext_sta_status_cb as the preferred callback method.| args | STA arguments (e.g., SSID, etc.). See mmwlan_sta_args. |
| sta_status_cb | Optional callback to be invoked on STA state changes. May be NULL. Must be NULL if args->ext_sta_status_cb is not NULL. |
| enum mmwlan_status mmwlan_twt_add_configuration | ( | const struct mmwlan_twt_config_args * | twt_config_args | ) |
Add configurations for Target Wake Time (TWT).
| twt_config_args | TWT configuration arguments mmwlan_twt_config_args. |