[wifi-manager]: Add new CAPI for WPS Scan 75/135475/4
authorManeesh Jain <maneesh.jain@samsung.com>
Thu, 22 Jun 2017 11:57:03 +0000 (17:27 +0530)
committertaesub kim <taesub.kim@samsung.com>
Mon, 3 Jul 2017 02:13:29 +0000 (02:13 +0000)
Description: This patch is used to add support of following CAPIs
to scan the network and extract the BSSID, ESSID & Channel
information.

1. wifi_manager_bssid_scan()
2. wifi_manager_foreach_found_bssid_ap()

Change-Id: Idc8a84ddb15bcee02c3f9adc9cb99cf123306b5b
Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
include/wifi-manager.h

index 4435d51..e2f7fec 100755 (executable)
@@ -740,6 +740,18 @@ typedef void(*wifi_manager_connected_cb)(wifi_manager_error_e result, void *user
 typedef void(*wifi_manager_disconnected_cb)(wifi_manager_error_e result, void *user_data);
 
 /**
+ * @brief Called when the BSSID scan is finished.
+ * @since_tizen 4.0
+ * @param[in] error_code    The error code
+ * @param[in] user_data     The user data passed from the callback registration function
+ * @see wifi_manager_scan()
+ * @see wifi_manager_bssid_scan()
+ * @see wifi_manager_set_background_scan_cb()
+ * @see wifi_manager_unset_background_scan_cb()
+ */
+typedef void(*wifi_manager_bssid_scan_finished_cb)(wifi_manager_error_e error_code, void *user_data);
+
+/**
 * @}
 */
 
@@ -1165,6 +1177,28 @@ int wifi_manager_foreach_found_specific_ap(wifi_manager_h wifi,
                wifi_manager_found_ap_cb callback, void *user_data);
 
 /**
+ * @brief Gets the result of the BSSID scan (i.e. BSSID, ESSID & RSSI).
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.get
+ * @param[in] wifi            The Wi-Fi handle
+ * @param[in] callback        The callback to be called
+ * @param[in] user_data       The user data passed to the callback function
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE                 Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER    Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_OPERATION_FAILED     Operation failed
+ * @retval #WIFI_MANAGER_ERROR_PERMISSION_DENIED    Permission Denied
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED        Not supported
+ * @post This function invokes wifi_manager_found_ap_cb().
+ * @see wifi_manager_scan_ap()
+ * @see wifi_manager_scan_specific_ap()
+ */
+int wifi_manager_foreach_found_bssid_ap(wifi_manager_h wifi,
+                               wifi_manager_found_ap_cb callback, void *user_data);
+
+
+/**
  * @brief Connects to the access point asynchronously.
  * @since_tizen 3.0
  * @privlevel public
@@ -1600,6 +1634,28 @@ int wifi_manager_unset_module_state_changed_cb(wifi_manager_h wifi);
 int wifi_manager_get_module_state(wifi_manager_h wifi, wifi_manager_module_state_e *state);
 
 /**
+ * @brief Starts BSSID scan asynchronously.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.set \n
+ *            %http://tizen.org/privilege/network.get
+ * @remark This function needs both privileges.
+ * @param[in] wifi            The Wi-Fi handle
+ * @param[in] callback        The callback function to be called
+ * @param[in] user_data       The user data passed to the callback function
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE                 Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER    Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_INVALID_OPERATION    Invalid operation
+ * @retval #WIFI_MANAGER_ERROR_OPERATION_FAILED     Operation failed
+ * @retval #WIFI_MANAGER_ERROR_PERMISSION_DENIED    Permission Denied
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED        Not supported
+ * @post This function invokes wifi_manager_bssid_scan_finished_cb().
+ */
+int wifi_manager_bssid_scan(wifi_manager_h wifi,
+               wifi_manager_bssid_scan_finished_cb callback, void *user_data);
+
+/**
 * @}
 */