Morse Micro IoT SDK  2.9.7
softap.c File Reference

Detailed Description

Soft AP 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 softap.c.

#include <string.h>
#include "mmconfig.h"
#include "mmosal.h"
#include "mmutils.h"
#include "mm_app_common.h"
#include "mm_app_loadconfig.h"
Include dependency graph for softap.c:

Go to the source code of this file.

Macros

#define STATIC_LOCAL_IP   "192.168.1.1"
 Statically configured IP address. More...
 
#define STATIC_GATEWAY   "192.168.1.1"
 Statically configured gateway address. More...
 
#define STATIC_NETMASK   "255.255.255.0"
 Statically configured netmask. More...
 
#define SOFTAP_SSID   SoftAP
 SSID of the AP. More...
 
#define SAE_PASSPHRASE   12345678
 Passphrase of the AP (ignored if security type is not SAE). More...
 
#define SECURITY_TYPE   MMWLAN_SAE
 Security type (. More...
 
#define PMF_MODE   MMWLAN_PMF_REQUIRED
 Protected Management Frames (PMF) mode (. More...
 
#define OP_CLASS   (25)
 Operating Class to use for Soft AP. More...
 
#define S1G_CHANNEL   (44)
 S1G Channel to use for Soft AP. More...
 
#define PRIMARY_BW_MHZ   (0)
 Primary Bandwidth to use for Soft AP. More...
 
#define PRIMARY_1MHZ_CHANNEL_INDEX   (0)
 Primary 1 MHz Channel Index to use for Soft AP. More...
 
#define _STRINGIFY(x)   #x
 Stringify macro. More...
 
#define STRINGIFY(x)   _STRINGIFY(x)
 Convert the content of the given macro to a string. More...
 

Functions

static void handle_softap_sta_status (const struct mmwlan_softap_sta_status *sta_status, void *arg)
 Handler for Soft AP STA Status callback. More...
 
static void load_softap_mmipal_init_args (struct mmipal_init_args *args)
 Loads the provided structure with initialization parameters read from config store. More...
 
void load_mmwlan_softap_args (struct mmwlan_softap_args *softap_args)
 Loads the provided structure with initialization parameters read from config store. More...
 
static void load_mmwlan_settings_softap (void)
 Loads various WLAN Soft AP specific settings from config store and applies them. More...
 
void app_init (void)
 Main entry point to the application. More...
 

Variables

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

Macro Definition Documentation

◆ _STRINGIFY

#define _STRINGIFY (   x)    #x

Stringify macro.

Do not use directly; use STRINGIFY().

Definition at line 117 of file softap.c.

◆ OP_CLASS

#define OP_CLASS   (25)

Operating Class to use for Soft AP.

This together with S1G_CHANNEL must correspond to a channel in the regulatory database.

Definition at line 87 of file softap.c.

◆ PMF_MODE

#define PMF_MODE   MMWLAN_PMF_REQUIRED

Protected Management Frames (PMF) mode (.

See also
mmwlan_pmf_mode).

Definition at line 72 of file softap.c.

◆ PRIMARY_1MHZ_CHANNEL_INDEX

#define PRIMARY_1MHZ_CHANNEL_INDEX   (0)

Primary 1 MHz Channel Index to use for Soft AP.

Definition at line 112 of file softap.c.

◆ PRIMARY_BW_MHZ

#define PRIMARY_BW_MHZ   (0)

Primary Bandwidth to use for Soft AP.

Valid values:

  • 0 (auto)
  • 1
  • 2

Definition at line 107 of file softap.c.

◆ S1G_CHANNEL

#define S1G_CHANNEL   (44)

S1G Channel to use for Soft AP.

This together with OP_CLASS must correspond to a channel in the regulatory database.

Definition at line 95 of file softap.c.

◆ SAE_PASSPHRASE

#define SAE_PASSPHRASE   12345678

Passphrase of the AP (ignored if security type is not SAE).

(Do not quote; it will be stringified.)

Definition at line 60 of file softap.c.

◆ SECURITY_TYPE

#define SECURITY_TYPE   MMWLAN_SAE

Security type (.

See also
mmwlan_security_type).

Definition at line 66 of file softap.c.

◆ SOFTAP_SSID

#define SOFTAP_SSID   SoftAP

SSID of the AP.

(Do not quote; it will be stringified.)

Definition at line 54 of file softap.c.

◆ STATIC_GATEWAY

#define STATIC_GATEWAY   "192.168.1.1"

Statically configured gateway address.

Definition at line 38 of file softap.c.

◆ STATIC_LOCAL_IP

#define STATIC_LOCAL_IP   "192.168.1.1"

Statically configured IP address.

Definition at line 34 of file softap.c.

◆ STATIC_NETMASK

#define STATIC_NETMASK   "255.255.255.0"

Statically configured netmask.

Definition at line 42 of file softap.c.

◆ STRINGIFY

#define STRINGIFY (   x)    _STRINGIFY(x)

Convert the content of the given macro to a string.

Definition at line 119 of file softap.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 374 of file softap.c.

◆ handle_softap_sta_status()

static void handle_softap_sta_status ( const struct mmwlan_softap_sta_status sta_status,
void *  arg 
)
static

Handler for Soft AP STA Status callback.

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

Definition at line 131 of file softap.c.

◆ load_mmwlan_settings_softap()

static void load_mmwlan_settings_softap ( void  )
static

Loads various WLAN Soft AP specific settings from config store and applies them.

Definition at line 319 of file softap.c.

◆ load_mmwlan_softap_args()

void load_mmwlan_softap_args ( struct mmwlan_softap_args softap_args)

Loads the provided structure with initialization parameters read from config store.

If a specific parameter is not found then default values are used. Use this function to load defaults before calling mmwlan_softap_enable().

Parameters
softap_argsA pointer to the mmwlan_softap_args to return the settings in.

Definition at line 177 of file softap.c.

◆ load_softap_mmipal_init_args()

static void load_softap_mmipal_init_args ( struct mmipal_init_args args)
static

Loads the provided structure with initialization parameters read from config store.

If a specific parameter is not found then default values are used. Use this function to load defaults before calling mmipal_init().

Note
This is a Soft AP specific implementation.
Parameters
argsA pointer to the mmipal_init_args to return the settings in.

Definition at line 153 of file softap.c.

Variable Documentation

◆ opaque_argument_value

uint32_t opaque_argument_value

A throw away variable for checking that the opaque argument is correct.

Definition at line 123 of file softap.c.