Merge "Add battery monitor framework" into tizen accepted/tizen/unified/20191017.072557 submit/tizen/20191014.104721 submit/tizen/20191016.060650
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 14 Oct 2019 09:50:03 +0000 (09:50 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 14 Oct 2019 09:50:03 +0000 (09:50 +0000)
include/clatd-handler.h
src/ip-conflict-detect.c
src/wifi-dpp.c

index 7e0fdc8..6976c08 100755 (executable)
@@ -24,9 +24,9 @@
 extern "C" {
 #endif
 
-#define CLATD_SERVICE  "com.samsung.clatd"
-#define CLATD_PATH             "/com/samsung/clatd"
-#define CLATD_INTERFACE        "com.samsung.clatd.Control"
+#define CLATD_SERVICE  "org.tizen.clatd"
+#define CLATD_PATH             "/org/tizen/clatd"
+#define CLATD_INTERFACE        "org.tizen.clatd.Control"
 
 int netconfig_clatd_enable(void);
 int netconfig_clatd_disable(void);
index 9021c04..2aad203 100755 (executable)
@@ -136,7 +136,7 @@ static gboolean __arp_reply_timeout_cb(gpointer data)
                initial_bursts = true;
        }
 
-       if (sd->timer_id > 0)
+       if (sd->timer_id)
                g_source_remove(sd->timer_id);
        sd->timer_id = g_timeout_add(sd->timeout, send_arp, sd);
        return G_SOURCE_REMOVE;
@@ -360,8 +360,10 @@ static gboolean send_arp(gpointer data)
                DBG("Sent ARP Packet \n");
        }
 
-       g_source_remove(sd->timer_id);
-       sd->timer_id = 0;
+       if (sd->timer_id) {
+               g_source_remove(sd->timer_id);
+               sd->timer_id = 0;
+       }
 
        if (conflict_state == NETCONFIG_IP_CONFLICT_STATE_CONFLICT_DETECTED || initial_bursts)
                sd->timeout = BURST_ARP_SEND_TIME;
@@ -395,8 +397,6 @@ struct sock_data * start_ip_conflict_mon(void)
        }
        sd->chk_conflict_data_id = -1;
        sd->chk_conflict_sd = -1;
-       sd->timer_id = 0;
-       sd->iteration = 0;
 
        if (__open_channel_and_sock(sd) == -1) {
                INFO("__open_channel_and_sock failed");
@@ -423,9 +423,8 @@ void stop_ip_conflict_mon()
        if (-1 < sd->chk_conflict_sd)
                __close_channel_and_sock(sd);
 
-       if (sd->timer_id > 0) {
+       if (sd->timer_id) {
                g_source_remove(sd->timer_id);
-               sd->timer_id = 0;
        }
        g_free(sd);
        sd = NULL;
index fdf7a8f..5d70239 100644 (file)
@@ -330,7 +330,8 @@ static gchar *__netconfig_get_p2p_address(const char *if_path)
 {
        GVariant *params = NULL;
        GVariant *message = NULL;
-       GVariant *temp = NULL;
+       GVariant *temp1 = NULL;
+       GVariant *temp2 = NULL;
        guchar p2p_addr[MACADDR_LEN] = {0,};
        gchar address_str[MACSTR_LEN] = {0,};
 
@@ -348,10 +349,13 @@ static gchar *__netconfig_get_p2p_address(const char *if_path)
        }
        DEBUG_G_VARIANT("reply:", message);
 
-       temp = g_variant_get_child_value(message, 0);
-       temp = g_variant_get_child_value(temp, 0);
-       DEBUG_G_VARIANT("temp:", temp);
-       __ws_unpack_ay(p2p_addr, temp, MACADDR_LEN);
+       temp1 = g_variant_get_child_value(message, 0);
+       temp2 = g_variant_get_child_value(temp1, 0);
+       DEBUG_G_VARIANT("temp2:", temp2);
+       __ws_unpack_ay(p2p_addr, temp2, MACADDR_LEN);
+       g_variant_unref(temp1);
+       g_variant_unref(temp2);
+
        g_snprintf(address_str, MACSTR_LEN, MACSTR, MAC2STR(p2p_addr));
 
        DBG("P2P address %s", address_str);
@@ -1394,6 +1398,7 @@ gboolean __save_passphrase(GKeyFile *keyfile, gchar *group_name, gchar *key, gch
                ret = FALSE;
        } else {
                g_key_file_set_string(keyfile, group_name, key, enc_data);
+               g_free(enc_data);
        }
 
        return ret;