Chnage usage to mah 81/231981/1 accepted/tizen/5.5/unified/20200427.221806 submit/tizen_5.5/20200427.061744
authorDewal Agarwal <d1.agarwal@samsung.com>
Mon, 27 Apr 2020 06:11:31 +0000 (11:41 +0530)
committerDewal Agarwal <d1.agarwal@samsung.com>
Mon, 27 Apr 2020 06:11:31 +0000 (11:41 +0530)
Change-Id: I513b1fb7aabdd3c192f89898ab23e50517c73082
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
src/battery_dump/bd_history_item.c

index 8efefd6..ee6219b 100644 (file)
@@ -151,7 +151,7 @@ static int bd_get_and_print_system_base_battery_usage_from_dump(int fd, long int
        GString *dump_p = NULL;
        dump_p = g_string_sized_new(30);
        BM_CHECK_MEM_ALLOC(dump_p, {});
-       double usage_mah = 0;
+       float usage_mah = 0;
        time_t crr_time = 0; time(&crr_time);
        int uid_n = 1000; //For Tizen
        // Base Resource usage;
@@ -454,9 +454,10 @@ static int bd_get_and_print_gwf_stat_entry_from_dump(int fd, long int duration)
        g_string_append(dump_p, ",0,l,");
        g_string_append(dump_p, "gwfcd,");
        //idle rx pwi tx
+       float usage_mah = (float)gwfl_stat->wifi_pwi_val/3600;
        g_string_append_printf(dump_p, "%ld,", gwfl_stat->wifi_idle_time);
        g_string_append_printf(dump_p, "%ld,", gwfl_stat->wifi_rx_time);
-       g_string_append_printf(dump_p, "%ld,", gwfl_stat->wifi_pwi_val);
+       g_string_append_printf(dump_p, "%0.2f,", usage_mah);
        g_string_append_printf(dump_p, "%ld", gwfl_stat->wifi_tx_time);
        g_string_append(dump_p, "\n");
        _DBG("%s", dump_p->str);//write
@@ -489,10 +490,11 @@ static int bd_get_and_print_gble_stat_entry_from_dump(int fd, long int duration)
        g_string_append(dump_p, TIZEN_DUMP_VERSION);
        g_string_append(dump_p, ",0,l,");
        g_string_append(dump_p, "gble,");
+       float usage_mah = (float)gble_stat->ble_pwi_val/3600;
        g_string_append_printf(dump_p, "%ld,", gble_stat->ble_idle_time);
        g_string_append_printf(dump_p, "%ld,", gble_stat->ble_rx_time);
        g_string_append_printf(dump_p, "%ld,", gble_stat->ble_tx_time);
-       g_string_append_printf(dump_p, "%ld", gble_stat->ble_pwi_val);
+       g_string_append_printf(dump_p, "%0.2f", usage_mah);
        g_string_append(dump_p, "\n");
 
        _DBG("%s", dump_p->str);//write