Add the Rx / Tx / idle time in the battery monitor 31/228831/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 24 Mar 2020 07:22:55 +0000 (16:22 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 25 Mar 2020 23:43:02 +0000 (08:43 +0900)
Change-Id: I3e9370f8f60791aef9d1414c1567a0e94b75f44c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bluetooth_type_internal.h
src/bluetooth-adapter.c
test/bt_unit_test.c

index 259609e..836078e 100644 (file)
@@ -305,11 +305,14 @@ typedef struct {
 } bt_map_client_message_s;
 
 typedef struct {
-        time_t session_start_time;
-        time_t session_end_time;
-        uint16_t session_connected_time;
-        uint16_t session_scan_time;
-        GSList *atm_list;
+       time_t session_start_time;
+       time_t session_end_time;
+       uint32_t tx_time;
+       uint32_t rx_time;
+       uint32_t idle_time;
+       uint16_t session_connected_time;
+       uint16_t session_scan_time;
+       GSList *atm_list;
 } bt_battery_info_s;
 
 typedef struct {
index 346189f..e570ad5 100644 (file)
@@ -79,12 +79,15 @@ int bt_adapter_read_battery_info(bt_battery_info_s *battery_data)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code),
                        error_code); /* LCOV_EXCL_LINE */
                return error_code;
-        } /* LCOV_EXCL_LINE */
+       } /* LCOV_EXCL_LINE */
 
        battery_data->session_start_time = data.session_start_time;
        battery_data->session_end_time = data.session_end_time;
        battery_data->session_scan_time = data.session_scan_time;
        battery_data->session_connected_time = data.session_connected_time;
+       battery_data->tx_time = data.tx_time;
+       battery_data->rx_time = data.rx_time;
+       battery_data->idle_time = data.idle_time;
        battery_data->atm_list = data.atm_list;
 
        BT_DBG("Battery Data in application layer: %ld %ld %d %d",
@@ -101,7 +104,8 @@ int bt_adapter_read_battery_info(bt_battery_info_s *battery_data)
                bt_battery_app_info_s *t = (bt_battery_app_info_s *)(l->data);
                BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
        }
-        return error_code;
+
+       return error_code;
 }
 
 int bt_adapter_disable(void)
index 61fd1ed..8d8a1b7 100644 (file)
@@ -4426,6 +4426,10 @@ int test_input_callback(void *data)
                        } else {
                                TC_PRT("Battery data: %ld %ld %d %d", battery_data.session_start_time,
                                        battery_data.session_end_time, battery_data.session_scan_time, battery_data.session_connected_time);
+
+                               TC_PRT("Tx time [%d], Rx time [%d], Idle time [%d]", battery_data.tx_time,
+                                       battery_data.rx_time, battery_data.idle_time);
+
                                if(battery_data.atm_list == NULL) {
                                        TC_PRT("No data transaction in this session");
                                        break;