service: Add frequency support to service
[platform/upstream/connman.git] / src / service.c
index 841d9a3..a6c764c 100644 (file)
@@ -29,6 +29,8 @@
 #include <netdb.h>
 #include <gdbus.h>
 
+#include <connman/storage.h>
+
 #include "connman.h"
 
 #define CONNECT_TIMEOUT                120
@@ -308,7 +310,7 @@ static int service_load(struct connman_service *service)
 
        DBG("service %p", service);
 
-       keyfile = __connman_storage_load_service(service->identifier);
+       keyfile = connman_storage_load_service(service->identifier);
        if (keyfile == NULL)
                return -EIO;
 
@@ -467,6 +469,7 @@ static int service_save(struct connman_service *service)
 {
        GKeyFile *keyfile;
        gchar *str;
+       guint freq;
        const char *cst_str = NULL;
        int err = 0;
 
@@ -516,6 +519,10 @@ static int service_save(struct connman_service *service)
 
                                g_string_free(str, TRUE);
                        }
+
+                       freq = connman_network_get_frequency(service->network);
+                       g_key_file_set_integer(keyfile, service->identifier,
+                                               "Frequency", freq);
                }
                /* fall through */
 
@@ -4489,7 +4496,7 @@ int __connman_service_connect(struct connman_service *service)
 
        if (service->userconnect == TRUE) {
                if (err == -ENOKEY) {
-                       if (__connman_agent_request_input(service,
+                       if (__connman_agent_request_passphrase_input(service,
                                                        request_input_cb,
                                                        NULL) == -EIO)
                                return -EINPROGRESS;
@@ -5119,7 +5126,7 @@ void __connman_service_read_ip6config(struct connman_service *service)
        if (service->ipconfig_ipv6 == NULL)
                return;
 
-       keyfile = __connman_storage_load_service(service->identifier);
+       keyfile = connman_storage_load_service(service->identifier);
        if (keyfile == NULL)
                return;