Morse Micro IoT SDK  2.9.7
twt_setup.c File Reference

Detailed Description

Demonstration of TWT setup.

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 file demonstrates how to configure TWT using the Morse Micro WLAN API. The device then connects to an AP using the given TWT configuration. Once connected, it is possible to observe the effect of TWT by pinging the device from the AP. The device will only respond to the ping during its service period. To get a better understanding of the effect of TWT, it is recommended to capture and review a sniffer trace to see the over-the-air behavior.

For more details about the theory and operation of TWT see the Morse Micro Application Note APPNOTE-03.

Definition in file twt_setup.c.

#include <string.h>
#include "mmosal.h"
#include "mmwlan.h"
#include "mmconfig.h"
#include "mm_app_common.h"
Include dependency graph for twt_setup.c:

Go to the source code of this file.

Functions

static enum mmwlan_status add_twt_configuration (uint32_t wake_interval_us, uint32_t min_wake_duration_us)
 Add a TWT configuration requesting a periodic service period with the given arguments. More...
 
void app_init (void)
 Main entry point to the application. More...
 

Function Documentation

◆ add_twt_configuration()

static enum mmwlan_status add_twt_configuration ( uint32_t  wake_interval_us,
uint32_t  min_wake_duration_us 
)
static

Add a TWT configuration requesting a periodic service period with the given arguments.

Note
Please see APPNOTE-03 Target Wake Time (TWT) for more detail regarding the TWT configuration arguments.
Parameters
wake_interval_usThe wake interval in microseconds.
min_wake_duration_usThe minimum wake duration in microseconds.
Returns
the status code returned by mmwlan_twt_add_configuration().

Definition at line 46 of file twt_setup.c.

◆ 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 73 of file twt_setup.c.