Wi-Fi State Machine (Station Mode) - Mediatek Labs LinkIt Connect 7681 Developer's Manual

Table of Contents

Advertisement

4.5.

Wi-Fi State Machine (Station mode)

When MT7681 is in Station mode it provides a Wi-Fi state machine for the Wi-Fi connection. The
entry function for this state machine is wifi_state_machine().
4.5.1.
States
There are in total 7 states, as shown in Figure 22:
WIFI_STATE_INIT
Initializes the Wi-Fi state machine and loads the target AP settings (SSID, Password,
AuthMode, and PMK) which are stored in Flash. If the settings are valid, the machine goes
to state WIFI_STATE_SCAN, otherwise it goes to WIFI_STATE_SMTCNT.
WIFI_STATE_SMTCNT
In this state the MT7681 will listen on Wi-Fi for a Smart Connection packet containing
target AP settings (SSID, Password, AuthMode, and PMK):
if a Smart Connection packet is received, the machine goes to WIFI_STATE_SCAN.
o
otherwise the machine goes back to WIFI_STATE_INIT.
o
If the AT command AT#Smnt is received, MT7681 will go into this state immediately.
WIFI_STATE_SCAN
When MT7681 gets target AP settings from WIFI_STATE_INIT or WIFI_STATE_SMTCNT, it
starts to switch channels and scan for the target AP.
if a probe response is received from the target AP, MT7681 will stay in the current
o
channel and check the AuthMode in the AP's Probe response frame, and update
AuthMode setting to local. Then go to WIFI_STATE_AUTH.
if the expected probe response isn't received within 10 seconds, MT7681 goes back to
o
WIFI_STATE_INIT.
WIFI_STATE_AUTH
MT7681 sends a Management frame (Auth Request) to the AP, then:
if an Auth Response is received with the status code 0 (Auth successful), MT7681 goes
o
to WIFI_STATE_ASSOC.
if an Auth Response is received with status code not equal to 0, a Deauth frame is
o
received from the target AP, or an Auth Response frame isn't received within 300ms
after retrying 5 times, MT7681 goes to WIFI_STATE_INIT.
There are sub-states for the authentication process:
Sub-State = 0, MT7681 is preparing to send Auth Request.
o
Sub-State = 1, MT7681 is waiting for Auth Response.
o
This document contains information that is proprietary to MediaTek Inc.
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited.
MediaTek LinkIt™ Connect 7681 Developer's Guide
© 2015, 2016 MediaTek Inc.
Page 32 of 65

Advertisement

Table of Contents
loading

Table of Contents