void battery_update_dn_rssi(int rssi)
{
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_dn_data == NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
DBG("[Battery DN] rssi(%ld) [%d]", curr_time, rssi);
if (g_dn_rssi_data.time != 0) {
void battery_start_dn_data(void)
{
battery_dn_data_s *dn_data = NULL;
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_dn_data != NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
__battery_print_dn_list();
dn_data = (battery_dn_data_s *)g_try_malloc0(sizeof(battery_dn_data_s));
void battery_end_dn_data(int mode, stc_get_stats_cb get_stats_cb)
{
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_dn_data == NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
battery_update_dn_rssi(-1);
if (mode == BATTERY_MODE_END) {
void battery_update_wifi_scan(int state)
{
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_wifi_data == NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
switch (state) {
case 0: /* scan done */
DBG("[Battery Wi-Fi] scan(%ld) [done]", curr_time);
void battery_update_wifi_rssi(int rssi)
{
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_wifi_data == NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
DBG("[Battery Wi-Fi] rssi(%ld) [%d]", curr_time, rssi);
if (g_wifi_rssi_data.time != 0) {
void battery_start_wifi_data(void)
{
battery_wifi_data_s *wifi_data = NULL;
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_wifi_data != NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
__battery_print_wifi_list();
wifi_data = (battery_wifi_data_s *)g_try_malloc0(sizeof(battery_wifi_data_s));
void battery_end_wifi_data(int mode, stc_get_stats_cb get_stats_cb)
{
- struct timespec curr_timespec;
- time_t curr_time;
+ time_t curr_time = time(NULL);
if (g_wifi_data == NULL)
return;
- clock_gettime(CLOCK_MONOTONIC, &curr_timespec);
- curr_time = curr_timespec.tv_sec;
-
battery_update_wifi_rssi(-1);
if (mode == BATTERY_MODE_END) {