wifi_manager_netlink_scan_finished_cb callback, void *user_data)
{
int rv;
- wifi_manager_device_state_e device_state;
+ bool enable;
+ int is_on = 0;
+ int vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI_AP;
wifi_netlink_scan_s *nl_scan = (wifi_netlink_scan_s *)netlink_scan;
- /** When tethering is enabled wlan interface is available but wifi device is
- in deactivated state and so to search APs wifi_manager_netlink_scan() API is used.
- When wifi device is in activated state use wifi_manager_scan() API instead. */
- rv = _wifi_get_wifi_device_state(&device_state);
- if (rv == WIFI_MANAGER_ERROR_NONE) {
- if (WIFI_MANAGER_DEVICE_STATE_ACTIVATED == device_state) {
- WIFI_LOG(WIFI_ERROR, "Invalid Operation, Device state activated.");
- return WIFI_MANAGER_ERROR_INVALID_OPERATION;
- }
+ /** When softap mode is enabled wifi device is in deactivated state,
+ so to search APs wifi_manager_netlink_scan() API is used.
+ When wifi device is in activated state use wifi_manager_scan() API instead. */
+ if (vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &is_on) != 0) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get vconf key of hotspot mode");
+ return WIFI_MANAGER_ERROR_OPERATION_FAILED;
+ }
+
+ enable = is_on & vconf_type ? true : false;
+
+ if (enable == false) {
+ WIFI_LOG(WIFI_ERROR, "SoftAP is not enabled");
+ return WIFI_MANAGER_ERROR_INVALID_OPERATION;
}
rv = net_netlink_scan_wifi(nl_scan->ssids, nl_scan->vsie);