Create temporary file to check wifi firmware state #2
[platform/core/connectivity/net-config.git] / src / network-statistics.c
index 7a02768..44f181e 100755 (executable)
@@ -54,7 +54,7 @@ gboolean netconfig_wifi_get_bytes_statistics(guint64 *tx, guint64 *rx)
                goto endline;
 
        while (fgets(buf, sizeof(buf), fp)) {
-               guint64 llval;
+               long long unsigned int llval;
                gulong lval;
 
                p_ifname = buf;
@@ -70,7 +70,7 @@ gboolean netconfig_wifi_get_bytes_statistics(guint64 *tx, guint64 *rx)
                sscanf(p_entry,
                                "%llu %llu %lu %lu %lu %lu %lu %lu "
                                "%llu %llu %lu %lu %lu %lu %lu %lu",
-                               rx,                     /* rx bytes */
+                               (long long unsigned int *)rx, /* rx bytes */
                                &llval,         /* rx packet */
                                &lval,          /* rx errors */
                                &lval,          /* rx dropped */
@@ -79,7 +79,7 @@ gboolean netconfig_wifi_get_bytes_statistics(guint64 *tx, guint64 *rx)
                                &lval,          /* rx compressed */
                                &lval,          /* rx multicast */
 
-                               tx,                     /* tx bytes */
+                               (long long unsigned int *)tx, /* tx bytes */
                                &llval,         /* tx packet */
                                &lval,          /* tx errors */
                                &lval,          /* tx dropped */
@@ -109,7 +109,7 @@ static gboolean handle_get_wifi_total_tx_bytes(
        guint64 total_bytes = 0;
        int val = 0;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, &val);
        tx_bytes = (guint64)val;
 
        if (netconfig_wifi_get_bytes_statistics(&tx, &rx) == TRUE)
@@ -130,7 +130,7 @@ static gboolean handle_get_wifi_total_rx_bytes(
        guint64 total_bytes = 0;
        int val = 0;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, &val);
        rx_bytes = (guint64)val;
 
        if (netconfig_wifi_get_bytes_statistics(&tx, &rx) == TRUE)
@@ -151,7 +151,7 @@ static gboolean handle_get_wifi_last_tx_bytes(
        guint64 last_bytes = 0;
        int val = 0;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, &val);
        tx_bytes = (guint64)val;
 
        if (wifi_state_get_service_state() != NETCONFIG_WIFI_CONNECTED) {
@@ -178,7 +178,7 @@ static gboolean handle_get_wifi_last_rx_bytes(
        guint64 last_bytes = 0;
        int val = 0;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, &val);
        rx_bytes = (guint64)val;
 
        if (wifi_state_get_service_state() != NETCONFIG_WIFI_CONNECTED) {
@@ -317,10 +317,10 @@ void netconfig_wifi_statistics_update_powered_off(void)
        if (netconfig_wifi_get_bytes_statistics(&cur_tx, &cur_rx) != TRUE)
                return;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, &val);
        prev_tx = (guint64)val;
 
-       vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, &val);
+       netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, &val);
        prev_rx = (guint64)val;
 
        total_tx = prev_tx + cur_tx;
@@ -355,10 +355,10 @@ static void wifi_statistics_update_state(wifi_service_state_e state, void *user_
                if (prev_state != NETCONFIG_WIFI_CONNECTED)
                        return;
 
-               vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, &val);
+               netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, &val);
                last_tx = (guint64)val;
 
-               vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, &val);
+               netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, &val);
                last_rx = (guint64)val;
 
                last_tx = tx < last_tx ? 0 : tx - last_tx;