Added support to Add, Get and Remove VSIE data and to get vsie information of each AP 47/158947/7
authortaesub kim <taesub.kim@samsung.com>
Mon, 6 Nov 2017 05:48:04 +0000 (14:48 +0900)
committertaesub kim <taesub.kim@samsung.com>
Tue, 14 Nov 2017 06:30:55 +0000 (15:30 +0900)
Change-Id: I7ad6cd29aee2ca9c00a640bc6cfabf5069c106b4
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
include/wifi-manager.h
include/wifi_manager_extension.h
test/wifi_manager_test.c

index b76464ab0f602b126ec4fe834a72eaab3880f371..519020cdd117fd39aa61680b57366bf20b6267c6 100755 (executable)
@@ -170,6 +170,7 @@ typedef enum {
 
 } wifi_manager_error_e;
 
+
 /**
 * @}
 */
@@ -764,6 +765,41 @@ typedef void *wifi_manager_config_h;
 * @{
 */
 
+/**
+ * @brief Enumeration for Wi-Fi Frame type.
+ * @since_tizen 5.0
+ * @see wifi_manager_add_vsie()
+ * @see wifi_manager_remove_vsie()
+ * @see wifi_manager_get_vsie()
+ */
+typedef enum {
+       /**
+        * WiFi probe request frame
+        */
+       WIFI_MANAGER_VSIE_FRAME_PROBE_REQ,
+
+       /**
+        * WiFi association request frame
+        */
+       WIFI_MANAGER_VSIE_FRAME_ASSOC_REQ,
+
+       /**
+        * WiFi re-association request frame
+        */
+       WIFI_MANAGER_VSIE_FRAME_REASSOC,
+
+       /**
+        * WiFi authentication request frame
+        */
+       WIFI_MANAGER_VSIE_FRAME_AUTH_REQ,
+
+       /**
+        * WiFi action frame
+        */
+       WIFI_MANAGER_VSIE_FRAME_ACTION,
+
+} wifi_manager_vsie_frames_e;
+
 /**
  * @brief Called for each found access point.
  * @since_tizen 3.0
@@ -1627,6 +1663,86 @@ int wifi_manager_forget_ap(wifi_manager_h wifi, wifi_manager_ap_h ap);
  */
 int wifi_manager_update_ap(wifi_manager_h wifi, wifi_manager_ap_h ap);
 
+/**
+ * @brief Adds the Wi-Fi Vendor Specific Information Element (VSIE) to a specific frame type.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.set
+ * @remarks @a vsie_str for @a frame_id will be in effect until Wi-Fi is deactivated.
+ *
+ * @param[in] wifi           The Wi-Fi handle
+ * @param[in] frame_id       The frame ID for setting VSIE
+ * @param[in] vsie_str       The VSIE data
+ *
+ * @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
+ * @pre Wi-Fi service must be activated by wifi_manager_activate().
+ * @see wifi_manager_activate()
+ * @see wifi_manager_remove_vsie()
+ * @see wifi_manager_get_vsie()
+ */
+int wifi_manager_add_vsie(wifi_manager_h wifi,
+               wifi_manager_vsie_frames_e frame_id, const char *vsie_str);
+
+/**
+ * @brief Gets the Wi-Fi Vendor Specific Information Elements (VSIE) from a specific frame.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.get
+ * @remarks @a vsie_str must be released with free().
+ *
+ * @param[in] wifi           The Wi-Fi handle
+ * @param[in] frame_id       The frame ID for getting VSIE
+ * @param[out] vsie_str      The VSIE data
+ *
+ * @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
+ * @pre Wi-Fi service must be activated by wifi_manager_activate()
+ *      and VSIE for a specific frame must be set with wifi_manager_add_vsie().
+ * @see wifi_manager_activate()
+ * @see wifi_manager_remove_vsie()
+ * @see wifi_manager_add_vsie()
+ */
+int wifi_manager_get_vsie(wifi_manager_h wifi,
+               wifi_manager_vsie_frames_e frame_id, char **vsie_str);
+
+/**
+ * @brief Removes the Wi-Fi Vendor Specific Information Element (VSIE) from specific frame.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.set
+ * @remarks @a vsie_str for @a frame_id will be in effect until Wi-Fi is deactivated.
+ *
+ * @param[in] wifi           The wifi handle
+ * @param[in] frame_id       The frame ID for removing VSIE
+ * @param[in] vsie_str       The VSIE data
+ *
+ * @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
+ * @pre Wi-Fi service must be activated by wifi_manager_activate()
+ *      and VSIE for a specific frame must be set with wifi_manager_add_vsie().
+ * @see wifi_manager_activate()
+ * @see wifi_manager_get_vsie()
+ * @see wifi_manager_add_vsie()
+ */
+int wifi_manager_remove_vsie(wifi_manager_h wifi,
+               wifi_manager_vsie_frames_e frame_id, const char *vsie_str);
+
 /**
 * @}
 */
@@ -2806,6 +2922,24 @@ int wifi_manager_ap_get_error_state(wifi_manager_ap_h ap, wifi_manager_error_e *
 
 int wifi_manager_ap_get_assoc_status_code(wifi_manager_ap_h ap,
                                                        wifi_manager_assoc_status_code_e *status_code);
+/**
+ * @brief Gets the VSIE result of the AP.
+ * @since_tizen 5.0
+ * @remarks You must release @a vsie using free().
+ *
+ * @param[in] ap               The access point handle
+ * @param[out] vsie            The vendor specific information element
+ * @param[out] length          The VSIE length
+ *
+ * @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_OUT_OF_MEMORY        Out of memory
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED        Not supported
+ */
+int wifi_manager_ap_get_vsie(wifi_manager_ap_h ap,
+               char **vsie, int *length);
+
 
 /**
 * @}
index 7945273e5d2d63b8d038ccb5d185a3b33a4e0b94..da31cd0811d4642c8d70246daa56db1055e6cf9c 100755 (executable)
@@ -47,45 +47,6 @@ typedef enum {
 * @}
 */
 
-/**
- * @brief Enumeration for Wi-Fi Frame type.
- * @since_tizen 4.0
- * @see wifi_manager_add_vsie()
- * @see wifi_manager_remove_vsie()
- * @see wifi_manager_get_vsie()
- */
-typedef enum {
-       /**
-        * WiFi probe request frame
-        */
-       WIFI_MANAGER_VSIE_FRAME_PROBE_REQ,
-
-       /**
-        * WiFi assocition request frame
-        */
-       WIFI_MANAGER_VSIE_FRAME_ASSOC_REQ,
-
-       /**
-        * WiFi re-assocition request frame
-        */
-       WIFI_MANAGER_VSIE_FRAME_REASSOC,
-
-       /**
-        * WiFi auth request frame
-        */
-       WIFI_MANAGER_VSIE_FRAME_AUTH_REQ,
-
-       /**
-        * WiFi auth request frame
-        */
-       WIFI_MANAGER_VSIE_FRAME_ACTION,
-
-} wifi_manager_vsie_frames_e;
-
-/**
-* @}
-*/
-
 /**
 * @addtogroup CAPI_NETWORK_WIFI_MANAGER_MANAGEMENT_MODULE
 * @{
@@ -161,98 +122,6 @@ int wifi_manager_set_autoscan_mode(wifi_manager_h wifi,
 int wifi_manager_get_autoscan_mode(wifi_manager_h wifi,
                wifi_manager_autoscan_mode_e *mode);
 
-/**
- * @brief Adds the Wi-Fi Vendor Specific Information Element (VSIE) to specific frame type.
- * @since_tizen 4.0
- * @remarks @a vsie_str for @a frame_id will be in effect until Wi-Fi is deactivated.
- *
- * @param[in] wifi           The Wi-Fi handle
- * @param[in] frame_id       The frame ID for setting VSIE
- * @param[in] vsie_str       The VSIE data
- *
- * @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
- * @pre Wi-Fi service must be activated by wifi_manager_activate().
- * @see wifi_manager_activate()
- * @see wifi_manager_remove_vsie()
- * @see wifi_manager_get_vsie()
- */
-int wifi_manager_add_vsie(wifi_manager_h wifi,
-               wifi_manager_vsie_frames_e frame_id, const char *vsie_str);
-
-/**
- * @brief Gets the Wi-Fi Vendor Specific Information Elements (VSIE) from specific frame.
- * @since_tizen 4.0
- * @remarks @a vsie_str must be released with free().
- *
- * @param[in] wifi           The Wi-Fi handle
- * @param[in] frame_id       The frame ID for setting VSIE
- * @param[out] vsie_str      The VSIE data
- *
- * @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
- * @pre Wi-Fi service must be activated by wifi_manager_activate()
- *      and set VSIE for specific frame by wifi_manager_add_vsie().
- * @see wifi_manager_activate()
- * @see wifi_manager_remove_vsie()
- * @see wifi_manager_add_vsie()
- */
-int wifi_manager_get_vsie(wifi_manager_h wifi,
-               wifi_manager_vsie_frames_e frame_id, char **vsie_str);
-
-/**
- * @brief Removes the Wi-Fi Vendor Specific Information Element (VSIE) from specific frame.
- * @since_tizen 4.0
- * @remarks @a vsie_str for @a frame_id will be in effect until Wi-Fi  is deactivated.
- *
- * @param[in] wifi           The wifi handle
- * @param[in] frame_id       The frame ID for removing VSIE
- * @param[in] vsie_str       The VSIE data
- *
- * @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
- * @pre Wi-Fi service must be activated by wifi_manabger_activate()
- *      and set VSIE for specific frame by wifi_manager_add_vsie().
- * @see wifi_manager_activate()
- * @see wifi_manager_get_vsie()
- * @see wifi_manager_add_vsie()
- */
-int wifi_manager_remove_vsie(wifi_manager_h wifi,
-               wifi_manager_vsie_frames_e frame_id, const char *vsie_str);
-
-/**
- * @brief Gets the vsie result of the AP.
- * @since_tizen 5.0
- * @remarks @a vsie must be released with free().
- *
- * @param[in] ap               The access point handle
- * @param[out] vsie            The vendor specific information element
- * @param[out] length          The VSIE length
- *
- * @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_OUT_OF_MEMORY       Out of memory
- * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED        Not supported
- */
-int wifi_manager_ap_get_vsie(wifi_manager_ap_h ap,
-                       char **vsie, int *length);
-
 /**
  * @brief Flush BSS
  * @since_tizen 4.0
index 82ee08109522996b8cd46925b64561ed18becb1b..c61baf65a615fc69c6e39563a40121fdf4f2b982 100755 (executable)
@@ -2721,22 +2721,22 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
                printf("x   - Enable TDLS Channel Switch Request\n");
                printf("y   - Disable TDLS Channel Switch Request\n");
                printf("z   - Get Wi-Fi Module State\n");
-               printf("A   - BSSID Scan\n");
-               printf("B   - Start Multi Scan\n");
+               printf("A   - BSSID Scan (Wi-Fi Position System Scan)\n");
+               printf("B   - Multi Scan (Multi Frequency & Multi SSID)\n");
+               printf("C   - Add VSIE\n");
+               printf("D   - Get VSIE\n");
+               printf("E   - Remove VSIE\n");
 /* Extension API */
                printf(LOG_BLUE "[Extension API]\n" LOG_END);
-               printf("C   - Set Auto Scan Enable-Disable\n");
-               printf("D   - Set Auto Scan Mode\n");
-               printf("E   - Get Auto Scan Enable-Disable\n");
-               printf("F   - Get Auto Scan Mode\n");
-               printf("G   - Add VSIE\n");
-               printf("H   - Get VSIE\n");
-               printf("I   - Remove VSIE\n");
+               printf("F   - Set Enable or Disable Auto Scan\n");
+               printf("G   - Set Mode of Auto Scan\n");
+               printf("H   - Get Enable or Disable Auto Scan\n");
+               printf("I   - Get Mode of Auto Scan\n");
                printf("J   - Flush BSS\n");
-               printf("K   - Set auto connect mode\n");
-               printf("L   - Get auto connect mode\n");
-               printf("M   - Set enable or disable of Wi-Fi profile auto-connect \n");
-               printf("N   - Get enable or disable of Wi-Fi profile auto-connect \n");
+               printf("K   - Set enable or disable auto connect\n");
+               printf("L   - Get enable or disable auto connect\n");
+               printf("M   - Set enable or disable of Wi-Fi profile auto-connect\n");
+               printf("N   - Get enable or disable of Wi-Fi profile auto-connect\n");
                printf(LOG_RED "0   - Exit \n" LOG_END);
 
                printf("ENTER  - Show options menu.......\n");
@@ -2855,27 +2855,27 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
        case 'B':
                rv = test_wifi_manager_specific_ap_start_multi_scan();
                break;
-/* Extension API */
        case 'C':
-               rv = test_wifi_manager_set_autoscan_state();
+               rv = test_wifi_manager_add_vsie();
                break;
        case 'D':
-               rv = test_wifi_manager_set_autoscan_mode();
+               rv = test_wifi_manager_get_vsie();
                break;
        case 'E':
-               rv = test_wifi_manager_get_autoscan_state();
+               rv = test_wifi_manager_remove_vsie();
                break;
+/* Extension API */
        case 'F':
-               rv = test_wifi_manager_get_autoscan_mode();
+               rv = test_wifi_manager_set_autoscan_state();
                break;
        case 'G':
-               rv = test_wifi_manager_add_vsie();
+               rv = test_wifi_manager_set_autoscan_mode();
                break;
        case 'H':
-               rv = test_wifi_manager_get_vsie();
+               rv = test_wifi_manager_get_autoscan_state();
                break;
        case 'I':
-               rv = test_wifi_manager_remove_vsie();
+               rv = test_wifi_manager_get_autoscan_mode();
                break;
        case 'J':
                rv = test_wifi_manager_flush_bss();