This section introduces MediaTek Smart Connection APIs including details on how to use the APIs, enums, structures and functions.
More...
This section introduces MediaTek Smart Connection APIs including details on how to use the APIs, enums, structures and functions.
How to use these APIs
- Connecting to the target AP with Smart Connection
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] | event | is the Smart Connection event. |
| [in] | data | is the reserved data. |
- Returns
- None
| 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] | ssid | is a pointer to the memory where the SSID is stored. |
| [out] | ssid_length | is a pointer to the memory where the length of SSID is stored. |
| [out] | password | is a pointer to the memory where the password is stored. |
| [out] | password_length | is a pointer to the memory where the length of password length is stored. |
| [out] | tlv_data | is a pointer to the memory where the tlv data is stored. |
| [out] | tlv_data_length | is a pointer to the memory where the length of tlv data is stored. |
- Returns
- WIFI_SMART_CONNECTION_OK, if the operation completed successfully.
This function registers a callback function to establish the Smart Connection.
- Parameters
-
| [in] | key | is the user-defined security key, to decrypt the information received through the Smart Connection. |
| [in] | key_length | is the length of the security key. |
| [in] | callback | is a user-defined callback to handle the Smart Connection events. |
- Returns
- WIFI_SMART_CONNECTION_OK, if the operation completed successfully.
This function starts the Smart Connection.
It should be called after wifi_smart_connection_init() for pre-allocated resources.
- Parameters
-
| [in] | timeout_seconds | is 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.
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.