Morse Micro IoT SDK  2.13.1
relay_mode.c File Reference

Detailed Description

Relay Mode Example Application.

Note
It is assumed that you have followed the steps in the Getting Started guide and are therefore familiar with how to build, flash, and monitor an application using the MM-IoT-SDK framework.

Definition in file relay_mode.c.

#include <string.h>
#include "mmwlan.h"
#include "mmconfig.h"
#include "mmosal.h"
#include "mmutils.h"
#include "mm_app_common.h"
#include "mm_app_loadconfig.h"
#include "mmlog.h"
#include "relay_mode_led.h"
Include dependency graph for relay_mode.c:

Go to the source code of this file.

Macros

#define MAX_STAS   MMWLAN_DEFAULT_AP_MAX_STAS
 The maximum number of stations that can connect to the AP. More...
 

Functions

static char * mmwlan_ap_sta_state_to_str (enum mmwlan_ap_sta_state state)
 Function to convert mmwlan_ap_sta_state enumeration to a human readable string. More...
 
static void handle_ap_sta_status (const struct mmwlan_ap_sta_status *sta_status, void *arg)
 Handler for AP STA Status callback. More...
 
static void handle_relay_depth_change (uint8_t new_depth, void *arg)
 Handler for relay depth change callback. More...
 
static void load_relay_mmwlan_ap_args (struct mmwlan_ap_args *ap_args)
 Loads the provided structure, with the subset of AP initialization parameters that are applicable to a relay, from config store. More...
 
static void load_mmwlan_relay_settings (void)
 Apply any relay mode specific settings from the config store. More...
 
void app_init (void)
 Main entry point to the application. More...
 

Variables

uint32_t opaque_argument_value
 A throwaway variable for checking that the opaque argument is correct. More...
 

Macro Definition Documentation

◆ MAX_STAS

#define MAX_STAS   MMWLAN_DEFAULT_AP_MAX_STAS

The maximum number of stations that can connect to the AP.

Must not be greater than MMWLAN_AP_MAX_STAS_LIMIT.

Definition at line 32 of file relay_mode.c.

Function Documentation

◆ app_init()

void app_init ( void  )

Main entry point to the application.

This will be invoked in a thread once operating system and hardware initialization has completed. It may return, but it does not have to.

Definition at line 207 of file relay_mode.c.

◆ handle_ap_sta_status()

static void handle_ap_sta_status ( const struct mmwlan_ap_sta_status *  sta_status,
void *  arg 
)
static

Handler for AP STA Status callback.

Parameters
sta_statusSTA status information.
argOpaque argument that was provided when the callback was registered.

Definition at line 71 of file relay_mode.c.

◆ handle_relay_depth_change()

static void handle_relay_depth_change ( uint8_t  new_depth,
void *  arg 
)
static

Handler for relay depth change callback.

Parameters
new_depthThe relay depth after the change.
argOpaque argument that was provided when the callback was registered.

Definition at line 90 of file relay_mode.c.

◆ load_mmwlan_relay_settings()

static void load_mmwlan_relay_settings ( void  )
static

Apply any relay mode specific settings from the config store.

Definition at line 180 of file relay_mode.c.

◆ load_relay_mmwlan_ap_args()

static void load_relay_mmwlan_ap_args ( struct mmwlan_ap_args *  ap_args)
static

Loads the provided structure, with the subset of AP initialization parameters that are applicable to a relay, from config store.

Parameters
ap_argsA pointer to the mmwlan_ap_args to return the settings in.

Definition at line 115 of file relay_mode.c.

◆ mmwlan_ap_sta_state_to_str()

static char * mmwlan_ap_sta_state_to_str ( enum mmwlan_ap_sta_state  state)
static

Function to convert mmwlan_ap_sta_state enumeration to a human readable string.

Parameters
stateState enum to convert
Returns
string representation of the enumeration.

Definition at line 45 of file relay_mode.c.

Variable Documentation

◆ opaque_argument_value

uint32_t opaque_argument_value

A throwaway variable for checking that the opaque argument is correct.

Definition at line 36 of file relay_mode.c.