![Mediatek Labs LinkIt Скачать руководство пользователя страница 35](http://html1.mh-extra.com/html/mediatek-labs/linkit/linkit_developers-manual_1760805035.webp)
MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 31 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.
Table 15. WPS APIs
Function
Description
wifi_wps_config_set_device_info()
This function sets the device information for WPS.
Call this function before triggering WPS connection.
wifi_wps_config_get_device_info()
This function gets the device information for WPS.
Call this function to check the device information
that’s already set.
wifi_wps_config_set_auto_connection()
This function sets the WPS auto connection after
receiving the credentials.
Set it to 1 to turn on the WI-FI connection after
receiving the credentials and 0, otherwise.
wifi_wps_config_get_auto_connection()
This function gets the WPS auto connection control
status.
0, turn off, 1, turn on
wifi_connection_register_event_handler()
This function registers the Wi-Fi event handler.
The event is
WIFI_EVENT_IOT_WPS_COMPLETE
.
wifi_wps_unregister_credential_handler()
This function unregisters Wi-Fi event handler.
The event is
WIFI_EVENT_IOT_WPS_COMPLETE
.
wifi_wps_connection_by_pbc()
This function triggers the WPS PBC process.
AP must act as Registrar and STA must act as Enrollee.
wifi_wps_connection_by_pin()
This function triggers the WPS PIN process.
AP can act as Registrar or Enrollee, STA should act as
Enrollee.
If the AP is an Enrollee, get the AP’s PIN and provide it
to the STA. The WPS PIN process of the AP will be
automatically triggered by the STA.
wifi_wps_config_get_pin_code()
This function gets the PIN code of a specific wireless
port. The PIN may be different each time the function
is called in the STA mode.
More information can be found in the Wi-Fi API Reference Manual.
2.7.1.
Using the APIs
To apply the Wi-Fi WPS APIs:
1)
Call
wifi_wps_config_set_device_info()
, to set up the WPS device configuration information
.
An example implementation shows how to set the device information.
wifi_wps_device_info_t input_devinfo;
int32_t wps_set_device_info_example()
{
char * device_name = "MTK IoT Test";
char * manufacturer = "MTK Test";