MT7687 API Reference  LinkIt SDK v4
Smart_Connection

This section introduces MediaTek Smart Connection APIs including details on how to use the APIs, enums, structures and functions. More...

Overview

This section introduces MediaTek Smart Connection APIs including details on how to use the APIs, enums, structures and functions.

How to use these APIs

Typedefs

typedef void(* wifi_smart_connection_callback_t) (wifi_smart_connection_event_t event, void *data)
 This callback function should be registered through the wifi_smart_connection_init(), and will be called when a Smart Connection event is received. More...
 

Functions

wifi_smart_connection_status_t wifi_smart_connection_init (const uint8_t *key, const uint8_t key_length, wifi_smart_connection_callback_t callback)
 This function registers a callback function to establish the Smart Connection. More...
 
void wifi_smart_connection_deinit (void)
 This function de-initializes the Smart Connection and releases the resources. More...
 
wifi_smart_connection_status_t wifi_smart_connection_start (uint16_t timeout_seconds)
 This function starts the Smart Connection. More...
 
wifi_smart_connection_status_t wifi_smart_connection_get_result (uint8_t *ssid, uint8_t *ssid_length, uint8_t *password, uint8_t *password_length, uint8_t *tlv_data, uint8_t *tlv_data_length)
 This function gets the Smart Connection result. More...
 
wifi_smart_connection_status_t wifi_smart_connection_stop (void)
 This function is called to inform smart connection task of exiting flag and then the task will automatically release the resources. More...
 

Modules

 Enum
 

Typedef Documentation

typedef void(* wifi_smart_connection_callback_t) (wifi_smart_connection_event_t event, void *data)

This callback function should be registered through the wifi_smart_connection_init(), and will be called when a Smart Connection event is received.

Parameters
[in]eventis the Smart Connection event.
[in]datais the reserved data.
Returns
None

Function Documentation

void wifi_smart_connection_deinit ( void  )

This function de-initializes the Smart Connection and releases the resources.

Returns
None
wifi_smart_connection_status_t wifi_smart_connection_get_result ( uint8_t *  ssid,
uint8_t *  ssid_length,
uint8_t *  password,
uint8_t *  password_length,
uint8_t *  tlv_data,
uint8_t *  tlv_data_length 
)

This function gets the Smart Connection result.

Call it once WIFI_SMART_CONNECTION_EVENT_INFO_COLLECTED is finished, or it will return an error.

Parameters
[out]ssidis a pointer to the memory where the SSID is stored.
[out]ssid_lengthis a pointer to the memory where the length of SSID is stored.
[out]passwordis a pointer to the memory where the password is stored.
[out]password_lengthis a pointer to the memory where the length of password length is stored.
[out]tlv_datais a pointer to the memory where the tlv data is stored.
[out]tlv_data_lengthis a pointer to the memory where the length of tlv data is stored.
Returns
WIFI_SMART_CONNECTION_OK, if the operation completed successfully.
wifi_smart_connection_status_t wifi_smart_connection_init ( const uint8_t *  key,
const uint8_t  key_length,
wifi_smart_connection_callback_t  callback 
)

This function registers a callback function to establish the Smart Connection.

Parameters
[in]keyis the user-defined security key, to decrypt the information received through the Smart Connection.
[in]key_lengthis the length of the security key.
[in]callbackis a user-defined callback to handle the Smart Connection events.
Returns
WIFI_SMART_CONNECTION_OK, if the operation completed successfully.
wifi_smart_connection_status_t wifi_smart_connection_start ( uint16_t  timeout_seconds)

This function starts the Smart Connection.

It should be called after wifi_smart_connection_init() for pre-allocated resources.

Parameters
[in]timeout_secondsis a user-defined timeout value in seconds. It implies smart connection failed once timeout is reached. if timeout_seconds == 0, will never time out
Returns
WIFI_SMART_CONNECTION_OK, if the operation completed successfully.
wifi_smart_connection_status_t wifi_smart_connection_stop ( void  )

This function is called to inform smart connection task of exiting flag and then the task will automatically release the resources.

Returns
WIFI_SMART_CONNECTION_OK, if the operation completed successfully.