MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 33 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.
An example implementation is shown below.
int32_t wps_get_auto_connection_status_example()
{
bool auto_conn = false;
return wifi_wps_config_get_auto_connection(&auto_conn);
}
2.7.1.2.
Register or unregister Wi-Fi WPS event handler
To register Wi-Fi WPS credential handler:
1)
Call
wifi_connection_register_event_handler()
.
An example implementation for the event handler is shown below.
int32_t wps_register_credential_event_handler_example()
{
return wifi_connection_register_event_handler(
WIFI_EVENT_IOT_WPS_COMPLETE, (wifi_event_handler_t)
wifi_wps_credential_event_handler_example);
}
An example implementation for the event handler
wifi_wps_credential_event_handler_example()
is
shown below.
int32_t int32_t wifi_wps_credential_event_handler_example(
wifi_event_t event,
uint8_t *payload, uint32_t length)
{
wifi_wps_credential_information_t *customer_cred = payload;
if (event = WIFI_EVENT_IOT_WPS_COMPLETE) {
LOG_I(minisupp, "WPS: ssid--%s\n", customer_cred->ssid);
LOG_I(minisupp, "WPS: ssid len--%d\n", customer_cred->ssid_len);
LOG_I(minisupp, "WPS: auth_mode-- %d\n" customer_cred->auth_mode);
LOG_I(minisupp, "WPS: encr_mode-- %d\n" customer_cred->encr_mode);
LOG_I(minisupp, "WPS: key_length--%d\n", customer_cred->key_length);
......
......
wifi_wps_unregister_credential_handler();
return 0;
}
To unregister Wi-Fi WPS credential event handler.
1)
Call the function
wifi_connection_unregister_event_handler()
to unregister the credential
handler. An example implementation is shown below.
int32_t wps_unregister_credential_event_handler_example()
{
return wifi_connection_unregister_event_handler(
WIFI_EVENT_IOT_WPS_COMPLETE, (wifi_event_handler_t)
wifi_wps_credential_event_handler_example);
}