#include <dumpsys-system.h>
#include <string.h>
#include <stdlib.h>
-#include <time.h>
+#include <sys/time.h>
#include <glib/gprintf.h>
#include <stdio.h>
#include <unistd.h>
_DBG("Wakereason_Tag_NULL");
dump_node->time_s = history_data[index].time_s;
- _DBG("TIME_S is %ld", dump_node->time_s);
+ _DBG("TIME_S is %lld", dump_node->time_s);
dump_node->time_current = history_data[index].time_current;
- _DBG("C TIME is %ld", dump_node->time_current);
+ _DBG("C TIME is %lld", dump_node->time_current);
EXIT;
return BATTERY_MONITOR_ERROR_NONE;
dump_p = g_string_append_c(dump_p, ',');
_DBG("value %s", dump_p->str);
if (old_state.time_s < 0) {
- g_string_append_printf(dump_p, "%ld",
+ g_string_append_printf(dump_p, "%lld",
(new_state.time_s - base_time));
_DBG("value %s", dump_p->str);
} else {
- g_string_append_printf(dump_p, "%ld",
+ g_string_append_printf(dump_p, "%lld",
(new_state.time_s - old_state.time_s));
_DBG("value %s", dump_p->str);
}
old_state.time_s = new_state.time_s;
- _DBG("Value old_state.time_s %ld", old_state.time_s);
+ _DBG("Value old_state.time_s %lld", old_state.time_s);
} else { //: Let's skip the NC mode in initial version
}
if (new_state.cmd_s == CM_ST) {
dump_p = g_string_append(dump_p, "TIME:");
_DBG("value %s", dump_p->str);
if (chkin) {
- g_string_append_printf(dump_p, "%ld", new_state.time_current);
+ g_string_append_printf(dump_p, "%lld", new_state.time_current);
_DBG("value %s", dump_p->str);
dump_p = g_string_append(dump_p, "\n");
_DBG("value %s", dump_p->str);
BM_CHECK_INPUT_PARAM(nrec);
int dvar1 = 0, dvar2 = 0;
- time_t current_time;
- time(¤t_time); //This time needs to be changed to MT
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ time_t current_time = tv.tv_sec;
// history_data[h_count].time_s = current_time;// comment for testing with test fn
history_data[h_count].time_s = nrec->time_s;
history_data[h_count].event_tag = nrec->event_tag;
}
if (nrec->cmd_s == CM_CRR_TIME || nrec->cmd_s == CM_RST)
- history_data[h_count].time_current = current_time;
+ history_data[h_count].time_current = ((long long)tv.tv_sec * 1000) + ((long long)tv.tv_usec / 1000);
history_data[h_count].state_1 = nrec->state_1;
history_data[h_count].state_2 = nrec->state_2;