Morse Micro IoT SDK  2.9.7
scan.c File Reference

Detailed Description

Example application to demonstrate using the MMWLAN scan subsystem.

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.

This example application provides a very basic demonstration of the MMWLAN scan API. It simply initiates a scan (with default arguments) and displays all results. Note that the MMWLAN scan implementation does not sort or cache scan results. As such, it is possible that a single Access Point may appear multiple times in the results displayed by this example application.

Definition in file scan.c.

#include <string.h>
#include "mmosal.h"
#include "mmutils.h"
#include "mmwlan.h"
#include "mm_app_loadconfig.h"
Include dependency graph for scan.c:

Go to the source code of this file.

Macros

#define ANSI_BOLD   "\x1b[1m"
 ANSI escape sequence for bold text. More...
 
#define ANSI_RESET   "\x1b[0m"
 ANSI escape sequence to reset font. More...
 
#define MAC_ADDR_STR_LEN   (18)
 Length of string representation of a MAC address (i.e., "XX:XX:XX:XX:XX:XX") including null terminator. More...
 

Functions

static void scan_rx_callback (const struct mmwlan_scan_result *result, void *arg)
 Scan rx callback. More...
 
static void scan_complete_callback (enum mmwlan_scan_state state, void *arg)
 Scan complete callback. More...
 
void app_init (void)
 Main entry point to the application. More...
 

Variables

static int num_scan_results
 Number of results found. More...
 

Macro Definition Documentation

◆ ANSI_BOLD

#define ANSI_BOLD   "\x1b[1m"

ANSI escape sequence for bold text.

Definition at line 33 of file scan.c.

◆ ANSI_RESET

#define ANSI_RESET   "\x1b[0m"

ANSI escape sequence to reset font.

Definition at line 35 of file scan.c.

◆ MAC_ADDR_STR_LEN

#define MAC_ADDR_STR_LEN   (18)

Length of string representation of a MAC address (i.e., "XX:XX:XX:XX:XX:XX") including null terminator.

Definition at line 45 of file scan.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 132 of file scan.c.

◆ scan_complete_callback()

static void scan_complete_callback ( enum mmwlan_scan_state  state,
void *  arg 
)
static

Scan complete callback.

Parameters
stateScan complete status.
argOpaque argument.

Definition at line 121 of file scan.c.

◆ scan_rx_callback()

static void scan_rx_callback ( const struct mmwlan_scan_result result,
void *  arg 
)
static

Scan rx callback.

Parameters
resultPointer to the scan result.
argOpaque argument.

Definition at line 56 of file scan.c.

Variable Documentation

◆ num_scan_results

int num_scan_results
static

Number of results found.

Definition at line 48 of file scan.c.