Activate WiFi and display popup with available networks if not automatically connected.

This set of functions will do anything that should be done to activate WiFi service and displaying popup with available WiFi networks if not automatically connected to any WiFi network. PRIVILEGES NEEDED: http://tizen.org/privilege/network.get http://tizen.org/privilege/network.set
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//    PRIVILEGES needed to be set in tizen-manifest.xml:
//    http://tizen.org/privilege/network.get
//    http://tizen.org/privilege/network.set
#include <wifi.h>
#include <dlog.h> // for logging purposes
//callback to be called when WiFi is activated
void on_wifi_activated(wifi_error_e result, void *user_data)
{
    if (result == WIFI_ERROR_NONE)
    {
        LOGI("WiFi activation request successfully finished!");
        bool wifi_activated = false;
        if (wifi_is_activated(&wifi_activated) == WIFI_ERROR_NONE)
        {
            if (wifi_activated)
            {
                LOGI("status: activated!");
            }
            else
            {
                LOGE("Error! WiFi not activated!");
            }
        }
        else
        {
            LOGE("Error! Could not check WiFi status!");
        }
    }
    else
    {
        LOGE("Error! WiFi activation failed!");
    }
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX