![Mediatek Labs LinkIt Developer'S Manual Download Page 30](http://html1.mh-extra.com/html/mediatek-labs/linkit/linkit_developers-manual_1760805030.webp)
MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 26 of 36
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
2)
Call the function
wifi_connection_start_scan()
to start scanning. During the scan, the beacon and
probe response in the air can be received and uploaded to
event_handler_sample()
registered in the
previous step.
wifi_connection_start_scan(NULL, 0, NULL, 0, 0);
3)
Call the function
wifi_connection_stop_scan()
to stop or cancel the scan.
wifi_connect_stop_scan();
Note 1. The handler registered with the event
WIFI_EVENT_IOT_SCAN_COMPLETE
is triggered when
the channel list is fully scanned or the function
wifi_connect_stop_scan()
is called
.
Note 2. When the device in station mode is not connected with an AP, it’ll continue the background scan
until connection is established.
2.5.
Smart Connection
MediaTek Smart Connection configures the device without an input interface to connect to the wireless network.
The Smart Connection broadcasts the encrypted wireless network information (SSID and password of the AP
router) through
SmartConnection
, an Android application package (APK) built with the Smart Connection library,
so that the IoT device based on the LinkIt development platform can listen and decode the information to connect
to the specified wireless network, as shown in Figure 3. The broadcast information is encrypted with a pre-defined
key to ensure security.
The APK can be found in the
<sdk_root>/tools/wifi_smart_connection
folder, where the Smart
Connection libraries for both Android and iOS are included. Users can also build custom Android or iOS
applications with the Smart Connection libraries.
Note, the HDK supports versions 4 and 5 of the Smart Connection protocol. Version 5 is enabled by
default.
2.5.1.
Smart Connection APIs
The Smart Connection APIs are provided in Table 13 for your reference.
The IoT device connects to the AP
Listen to and decode the
information to get the SSID and
AP
IoT Device
Phone
Broadcast the AP information (SSID, password)
Figure 3. Communicating with an IoT device using Smart Connection