Morse Micro IoT SDK  2.9.7

Detailed Description

Modules

 wlan configuration variables
 

Data Structures

struct  mmagic_core_wlan_connect_cmd_args
 Command arguments structure for wlan_connect. More...
 
struct  mmagic_core_wlan_scan_cmd_args
 Command arguments structure for wlan_scan. More...
 
struct  mmagic_core_wlan_scan_rsp_args
 Response arguments structure for wlan_scan. More...
 
struct  mmagic_core_wlan_get_rssi_rsp_args
 Response arguments structure for wlan_get_rssi. More...
 
struct  mmagic_core_wlan_get_mac_addr_rsp_args
 Response arguments structure for wlan_get_mac_addr. More...
 
struct  mmagic_core_wlan_wnm_sleep_cmd_args
 Command arguments structure for wlan_wnm_sleep. More...
 
struct  mmagic_core_wlan_beacon_monitor_enable_cmd_args
 Command arguments structure for wlan_beacon_monitor_enable. More...
 
struct  mmagic_core_wlan_standby_set_status_payload_cmd_args
 Command arguments structure for wlan_standby_set_status_payload. More...
 
struct  mmagic_core_wlan_standby_set_wake_filter_cmd_args
 Command arguments structure for wlan_standby_set_wake_filter. More...
 
struct  mmagic_core_wlan_standby_set_config_cmd_args
 Command arguments structure for wlan_standby_set_config. More...
 
struct  mmagic_core_wlan_get_sta_status_rsp_args
 Response arguments structure for wlan_get_sta_status. More...
 
struct  mmagic_wlan_beacon_rx_event_args
 Event arguments structure for wlan_beacon_rx. More...
 
struct  mmagic_wlan_standby_exit_event_args
 Event arguments structure for wlan_standby_exit. More...
 
struct  mmagic_wlan_sta_event_event_args
 Event arguments structure for wlan_sta_event. More...
 

Typedefs

typedef void(* mmagic_wlan_beacon_rx_event_handler_t) (const struct mmagic_wlan_beacon_rx_event_args *event_args, void *arg)
 Handler for the wlan-beacon_rx event. More...
 
typedef void(* mmagic_wlan_standby_exit_event_handler_t) (const struct mmagic_wlan_standby_exit_event_args *event_args, void *arg)
 Handler for the wlan-standby_exit event. More...
 
typedef void(* mmagic_wlan_sta_event_event_handler_t) (const struct mmagic_wlan_sta_event_event_args *event_args, void *arg)
 Handler for the wlan-sta_event event. More...
 

Functions

static enum mmagic_status mmagic_controller_wlan_connect (struct mmagic_controller *controller, struct mmagic_core_wlan_connect_cmd_args *cmd_args)
 Brings up the WLAN interface and connects to the AP with configured parameters. More...
 
static enum mmagic_status mmagic_controller_wlan_disconnect (struct mmagic_controller *controller)
 Disconnects and brings down the WLAN interface. More...
 
static enum mmagic_status mmagic_controller_wlan_scan (struct mmagic_controller *controller, struct mmagic_core_wlan_scan_cmd_args *cmd_args, struct mmagic_core_wlan_scan_rsp_args *rsp_args)
 Starts an undirected scan for available networks. More...
 
static enum mmagic_status mmagic_controller_wlan_get_rssi (struct mmagic_controller *controller, struct mmagic_core_wlan_get_rssi_rsp_args *rsp_args)
 Retrieves the RSSI if the WLAN interface is up, else 0. More...
 
static enum mmagic_status mmagic_controller_wlan_get_mac_addr (struct mmagic_controller *controller, struct mmagic_core_wlan_get_mac_addr_rsp_args *rsp_args)
 Retrieves the MAC address if the WLAN interface is up. More...
 
static enum mmagic_status mmagic_controller_wlan_wnm_sleep (struct mmagic_controller *controller, struct mmagic_core_wlan_wnm_sleep_cmd_args *cmd_args)
 Requests entry or exit from extended sleep (wnm sleep) if the WLAN interface is up. More...
 
static enum mmagic_status mmagic_controller_wlan_beacon_monitor_enable (struct mmagic_controller *controller, struct mmagic_core_wlan_beacon_monitor_enable_cmd_args *cmd_args)
 Enable beacon monitoring with the given filter settings. More...
 
static enum mmagic_status mmagic_controller_wlan_beacon_monitor_disable (struct mmagic_controller *controller)
 Disable beacon monitoring. More...
 
static enum mmagic_status mmagic_controller_wlan_standby_enter (struct mmagic_controller *controller)
 This puts the Morse chip into standby mode allowing the host processor to go to sleep 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. More...
 
static enum mmagic_status mmagic_controller_wlan_standby_exit (struct mmagic_controller *controller)
 Forces the Morse chip to exit standby mode. More...
 
static enum mmagic_status mmagic_controller_wlan_standby_set_status_payload (struct mmagic_controller *controller, struct mmagic_core_wlan_standby_set_status_payload_cmd_args *cmd_args)
 Sets the user payload for the standby status packet. More...
 
static enum mmagic_status mmagic_controller_wlan_standby_set_wake_filter (struct mmagic_controller *controller, struct mmagic_core_wlan_standby_set_wake_filter_cmd_args *cmd_args)
 Configures the standby mode UDP wake packet filter. More...
 
static enum mmagic_status mmagic_controller_wlan_standby_set_config (struct mmagic_controller *controller, struct mmagic_core_wlan_standby_set_config_cmd_args *cmd_args)
 Sets the standby mode configuration parameters. More...
 
static enum mmagic_status mmagic_controller_wlan_get_sta_status (struct mmagic_controller *controller, struct mmagic_core_wlan_get_sta_status_rsp_args *rsp_args)
 Retrieves the STA status of the WLAN interface. More...
 
void mmagic_controller_register_wlan_beacon_rx_handler (struct mmagic_controller *controller, mmagic_wlan_beacon_rx_event_handler_t handler, void *arg)
 Register a handler for the wlan-beacon_rx event. More...
 
void mmagic_controller_register_wlan_standby_exit_handler (struct mmagic_controller *controller, mmagic_wlan_standby_exit_event_handler_t handler, void *arg)
 Register a handler for the wlan-standby_exit event. More...
 
void mmagic_controller_register_wlan_sta_event_handler (struct mmagic_controller *controller, mmagic_wlan_sta_event_event_handler_t handler, void *arg)
 Register a handler for the wlan-sta_event event. More...
 

Typedef Documentation

◆ mmagic_wlan_beacon_rx_event_handler_t

typedef void(* mmagic_wlan_beacon_rx_event_handler_t) (const struct mmagic_wlan_beacon_rx_event_args *event_args, void *arg)

Handler for the wlan-beacon_rx event.

Triggered when a beacon matching the configured beacon monitor filter(s) is received.

Note
This function will be invoked in the context of the controller data link thread and should perform minimal processing.
Warning
This function must not invoke any mmagic API functions.
Parameters
event_argsNotication arguments received from the agent.
argOpaque argument that was provided when the callback was registered.

Definition at line 3293 of file mmagic_controller.h.

◆ mmagic_wlan_sta_event_event_handler_t

typedef void(* mmagic_wlan_sta_event_event_handler_t) (const struct mmagic_wlan_sta_event_event_args *event_args, void *arg)

Handler for the wlan-sta_event event.

Triggered when STA event occurs when in STA mode.

Note
This function will be invoked in the context of the controller data link thread and should perform minimal processing.
Warning
This function must not invoke any mmagic API functions.
Parameters
event_argsNotication arguments received from the agent.
argOpaque argument that was provided when the callback was registered.

Definition at line 3376 of file mmagic_controller.h.

◆ mmagic_wlan_standby_exit_event_handler_t

typedef void(* mmagic_wlan_standby_exit_event_handler_t) (const struct mmagic_wlan_standby_exit_event_args *event_args, void *arg)

Handler for the wlan-standby_exit event.

Triggered when chip exits standby mode either manually or through an event.

Note
This function will be invoked in the context of the controller data link thread and should perform minimal processing.
Warning
This function must not invoke any mmagic API functions.
Parameters
event_argsNotication arguments received from the agent.
argOpaque argument that was provided when the callback was registered.

Definition at line 3335 of file mmagic_controller.h.

Function Documentation

◆ mmagic_controller_register_wlan_beacon_rx_handler()

void mmagic_controller_register_wlan_beacon_rx_handler ( struct mmagic_controller *  controller,
mmagic_wlan_beacon_rx_event_handler_t  handler,
void *  arg 
)

Register a handler for the wlan-beacon_rx event.

Triggered when a beacon matching the configured beacon monitor filter(s) is received.

Note
The handler callbacks will be invoked in the context of the controller data link thread. The handler should perform minimal processing.
Warning
The handler callback must not invoke any mmagic API functions.
Parameters
controllerReference to the the controller handle.
handlerThe handler function to register.
argOpaque argument to be passed to the handler when it is invoked.

◆ mmagic_controller_register_wlan_sta_event_handler()

void mmagic_controller_register_wlan_sta_event_handler ( struct mmagic_controller *  controller,
mmagic_wlan_sta_event_event_handler_t  handler,
void *  arg 
)

Register a handler for the wlan-sta_event event.

Triggered when STA event occurs when in STA mode.

Note
The handler callbacks will be invoked in the context of the controller data link thread. The handler should perform minimal processing.
Warning
The handler callback must not invoke any mmagic API functions.
Parameters
controllerReference to the the controller handle.
handlerThe handler function to register.
argOpaque argument to be passed to the handler when it is invoked.

◆ mmagic_controller_register_wlan_standby_exit_handler()

void mmagic_controller_register_wlan_standby_exit_handler ( struct mmagic_controller *  controller,
mmagic_wlan_standby_exit_event_handler_t  handler,
void *  arg 
)

Register a handler for the wlan-standby_exit event.

Triggered when chip exits standby mode either manually or through an event.

Note
The handler callbacks will be invoked in the context of the controller data link thread. The handler should perform minimal processing.
Warning
The handler callback must not invoke any mmagic API functions.
Parameters
controllerReference to the the controller handle.
handlerThe handler function to register.
argOpaque argument to be passed to the handler when it is invoked.

◆ mmagic_controller_wlan_beacon_monitor_disable()

static enum mmagic_status mmagic_controller_wlan_beacon_monitor_disable ( struct mmagic_controller *  controller)
inlinestatic

Disable beacon monitoring.

If beacon monitor is not enabled then this has no effect.

Parameters
controllerReference to the controller handle.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3018 of file mmagic_controller.h.

◆ mmagic_controller_wlan_beacon_monitor_enable()

static enum mmagic_status mmagic_controller_wlan_beacon_monitor_enable ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_beacon_monitor_enable_cmd_args cmd_args 
)
inlinestatic

Enable beacon monitoring with the given filter settings.

If beacon monitoring is already enabled it will be reconfigured with the given arguments.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2989 of file mmagic_controller.h.

◆ mmagic_controller_wlan_connect()

static enum mmagic_status mmagic_controller_wlan_connect ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_connect_cmd_args cmd_args 
)
inlinestatic

Brings up the WLAN interface and connects to the AP with configured parameters.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2750 of file mmagic_controller.h.

◆ mmagic_controller_wlan_disconnect()

static enum mmagic_status mmagic_controller_wlan_disconnect ( struct mmagic_controller *  controller)
inlinestatic

Disconnects and brings down the WLAN interface.

Parameters
controllerReference to the controller handle.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2787 of file mmagic_controller.h.

◆ mmagic_controller_wlan_get_mac_addr()

static enum mmagic_status mmagic_controller_wlan_get_mac_addr ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_get_mac_addr_rsp_args rsp_args 
)
inlinestatic

Retrieves the MAC address if the WLAN interface is up.

Parameters
controllerReference to the controller handle.
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2918 of file mmagic_controller.h.

◆ mmagic_controller_wlan_get_rssi()

static enum mmagic_status mmagic_controller_wlan_get_rssi ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_get_rssi_rsp_args rsp_args 
)
inlinestatic

Retrieves the RSSI if the WLAN interface is up, else 0.

Parameters
controllerReference to the controller handle.
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2881 of file mmagic_controller.h.

◆ mmagic_controller_wlan_get_sta_status()

static enum mmagic_status mmagic_controller_wlan_get_sta_status ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_get_sta_status_rsp_args rsp_args 
)
inlinestatic

Retrieves the STA status of the WLAN interface.

Parameters
controllerReference to the controller handle.
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3248 of file mmagic_controller.h.

◆ mmagic_controller_wlan_scan()

static enum mmagic_status mmagic_controller_wlan_scan ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_scan_cmd_args cmd_args,
struct mmagic_core_wlan_scan_rsp_args rsp_args 
)
inlinestatic

Starts an undirected scan for available networks.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2833 of file mmagic_controller.h.

◆ mmagic_controller_wlan_standby_enter()

static enum mmagic_status mmagic_controller_wlan_standby_enter ( struct mmagic_controller *  controller)
inlinestatic

This puts the Morse chip into standby mode allowing the host processor to go to sleep 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.

Parameters
controllerReference to the controller handle.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3046 of file mmagic_controller.h.

◆ mmagic_controller_wlan_standby_exit()

static enum mmagic_status mmagic_controller_wlan_standby_exit ( struct mmagic_controller *  controller)
inlinestatic

Forces the Morse chip to exit standby mode.

There may be certain instances such as a timer expiry, which cause the host chip to wake up independant of the Morse chip. In such situations, the host calls this function to instruct the Morse chip to exit standby mode and return to normal operating mode.

Parameters
controllerReference to the controller handle.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3074 of file mmagic_controller.h.

◆ mmagic_controller_wlan_standby_set_config()

static enum mmagic_status mmagic_controller_wlan_standby_set_config ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_standby_set_config_cmd_args cmd_args 
)
inlinestatic

Sets the standby mode configuration parameters.

If this command is not executed then the defaults are as specified.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3209 of file mmagic_controller.h.

◆ mmagic_controller_wlan_standby_set_status_payload()

static enum mmagic_status mmagic_controller_wlan_standby_set_status_payload ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_standby_set_status_payload_cmd_args cmd_args 
)
inlinestatic

Sets the user payload for the standby status packet.

Once standby mode is enabled, the Morse chip will periodically emit a UDP standby status packet regardless of whether it is in standby or not. The UDP packet will also be sent immediately upon entering or exiting Standby mode. If this command is not executed then the standby status packet will contain no payload.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3110 of file mmagic_controller.h.

◆ mmagic_controller_wlan_standby_set_wake_filter()

static enum mmagic_status mmagic_controller_wlan_standby_set_wake_filter ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_standby_set_wake_filter_cmd_args cmd_args 
)
inlinestatic

Configures the standby mode UDP wake packet filter.

The system can be woken up from standby mode by sending it a UDP wake packet. If a wake filter is set using this function then the wake packet will only wake up the system if the specified filter pattern matches the payload at the specified offset within the payload. If this command is not executed then any wake packet will wake up the system.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 3153 of file mmagic_controller.h.

◆ mmagic_controller_wlan_wnm_sleep()

static enum mmagic_status mmagic_controller_wlan_wnm_sleep ( struct mmagic_controller *  controller,
struct mmagic_core_wlan_wnm_sleep_cmd_args cmd_args 
)
inlinestatic

Requests entry or exit from extended sleep (wnm sleep) if the WLAN interface is up.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 2953 of file mmagic_controller.h.