summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDewal Agarwal <d1.agarwal@samsung.com>2020-04-27 11:41:31 +0530
committerDewal Agarwal <d1.agarwal@samsung.com>2020-04-27 11:41:31 +0530
commit31759f61ff9c3039d3fbb3cbed9fb342c46e9b4c (patch)
treea29af23ae1717142662d009c9fe2ca140acd12ba
parent7e0b00ff75626818ebd1e2afce710b73e9a025ce (diff)
downloadbatterymonitor-31759f61ff9c3039d3fbb3cbed9fb342c46e9b4c.tar.gz
batterymonitor-31759f61ff9c3039d3fbb3cbed9fb342c46e9b4c.tar.bz2
batterymonitor-31759f61ff9c3039d3fbb3cbed9fb342c46e9b4c.zip
Change-Id: I513b1fb7aabdd3c192f89898ab23e50517c73082 Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
-rw-r--r--src/battery_dump/bd_history_item.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/battery_dump/bd_history_item.c b/src/battery_dump/bd_history_item.c
index 8efefd6..ee6219b 100644
--- a/src/battery_dump/bd_history_item.c
+++ b/src/battery_dump/bd_history_item.c
@@ -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