Mediatek Labs LinkIt Connect 7681 Developer's Manual page 43

Table of Contents

Advertisement

When the user taps Start, the app runs to JNI_StartSmartConnection() that calls
StartSmartConnection to begin broadcasting. The code for this is shown below:
File: IoTManage_jni.cpp
static jint JNI_StartSmartConnection(JNIEnv *env, jobject thiz, jstring
nSSID, jstring nPassword, jbyte nAuth)
{
int iRst = 0;
const char *pSSID = NULL;
const char *pPassword = NULL;
pSSID = env->GetStringUTFChars(nSSID, 0);
pPassword = env->GetStringUTFChars(nPassword, 0);
iRst = StartSmartConnection(pSSID, pPassword, (char)nAuth);
if (iRst != 0)
{
HWTEST_LOGD("StartSmartConnection error.");
}
HWTEST_LOGD("Leave JNI_StartSmartConnection.");
return iRst;
}
When the device containing the MT7681 is turned on, it will enter Smart Connection mode, receive
the broadcast packets and attempt to connect to the defined AP.
During this process the MT7681 writes a log to UART, here is an example:
==> Recovery Mode
<== Recovery Mode
(-)
SM=0, Sub=0
SM=1, Sub=0
[WTask]5001
SM=2, Sub=0
SM=3, Sub=0
Request*/
Auth with:ssid = RalinkAP, auth mode = 0,
information "SSID, AuthMode"-- */
SM=3, Sub=1
Response*/
SM=4, Sub=0
Request*/
SM=4, Sub=1
Response */
[WTask]10005
SM=6, Sub=0
[WTask]15006
Got IP:192.168.2.12/* Got IP from target AP*/
[WTask]20009
When MT7681 completes the Smart Connection process (it has connected to the target AP and
obtained an IP address), it will store the configuration to Flash. Then, when MT7681 restarts it will
load the setting from Flash and directly go to Scan state, instead of Smart Connection state.
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
/*start to running recovery/Calibration image*/
/* end to running recovery/Calibration image*/
/* start to running station image*/
/* Change to "WIFI_STATE_INIT" */
/* Change to "WIFI_STATE_SMTCNT" */
/*--output timer log period to notice system alive--*/
/* Change to "WIFI_STATE_SCAN" */
/* Change to "WIFI_STATE_AUTH", is going to send Auth
/* Change to "WIFI_STATE_AUTH" is waiting Auth
/* Change to "WIFI_STATE_ASSOC", is going to send Assoc
/* Change to "WIFI_STATE_ASSOC", is waiting Assoc
/* Change to "WIFI_STATE_CONNED", start to get IP*/
© 2015, 2016 MediaTek Inc.
/*--output the target AP's
Page 38 of 65

Advertisement

Table of Contents
loading

Related Products for Mediatek Labs LinkIt Connect 7681

Table of Contents