Morse Micro IoT SDK  2.10.4
WLAN Control API for Scan

Detailed Description

API for performing WLAN Scan operations.

Data Structures

struct  mmwlan_scan_result
 Result of the scan request. More...
 
struct  mmwlan_scan_config
 Scan configuration data structure. More...
 
struct  mmwlan_scan_args
 Structure to hold scan arguments. More...
 
struct  mmwlan_scan_req
 Structure to hold arguments specific to a given instance of a scan. More...
 

Macros

#define MMWLAN_SCAN_CONFIG_INIT    { MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS, false, MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS }
 Initializer for mmwlan_scan_config. More...
 
#define MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS   (30)
 Default value for mmwlan_scan_args.dwell_time_ms. More...
 
#define MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS   (200)
 Default time to dwell on home channel, in between scan channels. More...
 
#define MMWLAN_SCAN_MIN_DWELL_TIME_MS   (15)
 Minimum value for mmwlan_scan_args.dwell_time_ms. More...
 
#define MMWLAN_SCAN_ARGS_INIT
 Initializer for mmwlan_scan_args. More...
 
#define MMWLAN_SCAN_REQ_INIT   { NULL, NULL, NULL, MMWLAN_SCAN_ARGS_INIT }
 Initializer for mmwlan_scan_req. More...
 

Typedefs

typedef void(* mmwlan_scan_rx_cb_t) (const struct mmwlan_scan_result *result, void *arg)
 mmwlan scan rx callback function prototype. More...
 
typedef void(* mmwlan_scan_complete_cb_t) (enum mmwlan_scan_state scan_state, void *arg)
 mmwlan scan complete callback function prototype. More...
 

Enumerations

enum  mmwlan_scan_state { MMWLAN_SCAN_SUCCESSFUL , MMWLAN_SCAN_TERMINATED , MMWLAN_SCAN_RUNNING }
 Enumeration of states in Scan mode. More...
 

Functions

enum mmwlan_status mmwlan_set_scan_config (const struct mmwlan_scan_config *config)
 Update the scan configuration with the given settings. More...
 
enum mmwlan_status mmwlan_scan_request (const struct mmwlan_scan_req *scan_req)
 Request a scan. More...
 
enum mmwlan_status mmwlan_scan_abort (void)
 Abort in progress or pending scans. More...
 

Macro Definition Documentation

◆ MMWLAN_SCAN_ARGS_INIT

#define MMWLAN_SCAN_ARGS_INIT
Value:
{ \
.extra_ies = NULL, \
.extra_ies_len = 0, \
.ssid = { 0 }, \
.ssid_len = 0, \
.dwell_on_home_ms = MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS, \
}
#define MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS
Default value for mmwlan_scan_args.dwell_time_ms.
Definition: mmwlan.h:790
#define MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS
Default time to dwell on home channel, in between scan channels.
Definition: mmwlan.h:792

Initializer for mmwlan_scan_args.

For example:

#define MMWLAN_SCAN_ARGS_INIT
Initializer for mmwlan_scan_args.
Definition: mmwlan.h:858
Structure to hold scan arguments.
Definition: mmwlan.h:819

Definition at line 858 of file mmwlan.h.

◆ MMWLAN_SCAN_CONFIG_INIT

#define MMWLAN_SCAN_CONFIG_INIT    { MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS, false, MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS }

Initializer for mmwlan_scan_config.

Definition at line 777 of file mmwlan.h.

◆ MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS

#define MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS   (200)

Default time to dwell on home channel, in between scan channels.

Definition at line 792 of file mmwlan.h.

◆ MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS

#define MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS   (30)

Default value for mmwlan_scan_args.dwell_time_ms.

Note that reducing the dwell time below this value may impact scan reliability.

Definition at line 790 of file mmwlan.h.

◆ MMWLAN_SCAN_MIN_DWELL_TIME_MS

#define MMWLAN_SCAN_MIN_DWELL_TIME_MS   (15)

Minimum value for mmwlan_scan_args.dwell_time_ms.

Definition at line 795 of file mmwlan.h.

◆ MMWLAN_SCAN_REQ_INIT

#define MMWLAN_SCAN_REQ_INIT   { NULL, NULL, NULL, MMWLAN_SCAN_ARGS_INIT }

Initializer for mmwlan_scan_req.

For example:

#define MMWLAN_SCAN_REQ_INIT
Initializer for mmwlan_scan_req.
Definition: mmwlan.h:892
Structure to hold arguments specific to a given instance of a scan.
Definition: mmwlan.h:872

Definition at line 892 of file mmwlan.h.

Typedef Documentation

◆ mmwlan_scan_complete_cb_t

typedef void(* mmwlan_scan_complete_cb_t) (enum mmwlan_scan_state scan_state, void *arg)

mmwlan scan complete callback function prototype.

Definition at line 812 of file mmwlan.h.

◆ mmwlan_scan_rx_cb_t

typedef void(* mmwlan_scan_rx_cb_t) (const struct mmwlan_scan_result *result, void *arg)

mmwlan scan rx callback function prototype.

Definition at line 731 of file mmwlan.h.

Enumeration Type Documentation

◆ mmwlan_scan_state

Enumeration of states in Scan mode.

Enumerator
MMWLAN_SCAN_SUCCESSFUL 

Scan was successful and all channels were scanned.

MMWLAN_SCAN_TERMINATED 

Scan was incomplete.

One or more channels may have been scanned and therefore an incomplete set of scan results may still have been received.

MMWLAN_SCAN_RUNNING 

Scanning in progress.

Definition at line 800 of file mmwlan.h.

Function Documentation

◆ mmwlan_scan_abort()

enum mmwlan_status mmwlan_scan_abort ( void  )

Abort in progress or pending scans.

The scan callback will be called back with result code MMWLAN_SCAN_TERMINATED for all aborted scans.

Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_scan_request()

enum mmwlan_status mmwlan_scan_request ( const struct mmwlan_scan_req scan_req)

Request a scan.

If the transceiver is not already powered on, it will be powered on before the scan is initiated. The power on procedure will block this function. The transceiver will remain powered on after scan completion and must be shutdown by invoking mmwlan_shutdown().

Note
Just because a scan is requested does not mean it will happen immediately. It may take some time for the request to be serviced.
The scan request may be rejected, in which case the complete callback will be invoked immediately with an error status.
Parameters
scan_reqScan request instance. See mmwlan_scan_req.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_scan_config()

enum mmwlan_status mmwlan_set_scan_config ( const struct mmwlan_scan_config config)

Update the scan configuration with the given settings.

Parameters
configThe new configuration to set.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.