Add time member to app info structure for battery monitor plugin 09/218309/1
authorSudipto Bal <sudipto.bal@samsung.com>
Thu, 21 Nov 2019 07:44:12 +0000 (16:44 +0900)
committerSudipto Bal <sudipto.bal@samsung.com>
Thu, 21 Nov 2019 07:44:12 +0000 (16:44 +0900)
Change-Id: If3af67cc2c4a779fe8a70003c15bb6aa0fbf290a
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
bt-api/bt-adapter.c
bt-api/bt-event-handler.c
bt-service-adaptation/services/bt-request-handler.c
bt-service-adaptation/services/bt-service-battery-monitor.c
bt-service-adaptation/services/include/bt-service-battery-monitor.h
include/bluetooth-api.h

index 4a2f6e4..81d5823 100644 (file)
@@ -192,7 +192,7 @@ BT_EXPORT_API int bluetooth_read_battery_data(bt_battery_data *data)
        BT_DBG("App-wise data transaction details:");
        for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
                bt_battery_app_data *t = (bt_battery_app_data *)(l->data);
-               BT_DBG("%ld %ld %d %d", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes);
+               BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
        }
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
index 913563e..a9b24c9 100644 (file)
@@ -497,7 +497,7 @@ void __bt_adapter_event_filter(GDBusConnection *connection,
                        BT_INFO("App-wise data transaction details:");
                        for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
                                bt_battery_app_data *t = (bt_battery_app_data *)(l->data);
-                               BT_DBG("%ld %ld %d %d", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes);
+                               BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
                        }
                }
 
index 4c1dd26..47175a5 100644 (file)
@@ -256,7 +256,7 @@ void _bt_save_invocation_context(GDBusMethodInvocation *invocation, int result,
 
 static int __bt_bm_request_data(_bt_battery_data_t *latest)
 {
-        int ret = _bt_bm_read_data(latest);
+       int ret = _bt_bm_read_data(latest);
        if (ret == BLUETOOTH_ERROR_NONE) {
                BT_DBG("Received data from bluetooth battery monitor: %ld %ld %d %d",
                        latest->session_start_time, latest->session_end_time,
index 930f05f..33a11b4 100644 (file)
@@ -90,7 +90,7 @@ int _bt_bm_read_data(_bt_battery_data_t *data)
        BT_DBG("App-wise data transaction details");
        for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
                _bt_battery_app_data_t *t = (_bt_battery_app_data_t *)(l->data);
-               BT_DBG("%ld %ld %d %d", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes);
+               BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
        }
 
        current_session_data->atm_list = NULL;
index 89e4434..2cff901 100644 (file)
@@ -35,6 +35,7 @@ typedef struct {
        pid_t pid;
        uint16_t rx_bytes;
        uint16_t tx_bytes;
+       uint time;
 } _bt_battery_app_data_t;
 
 typedef struct {
index 3ff8a99..c0249b4 100644 (file)
@@ -327,11 +327,11 @@ typedef struct {
  */
 
 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;
+       uint16_t session_connected_time;
+       uint16_t session_scan_time;
+       GSList *atm_list;
 } bt_battery_data;
 
 typedef struct {
@@ -339,6 +339,7 @@ typedef struct {
        pid_t pid;
        uint16_t rx_bytes;
        uint16_t tx_bytes;
+       uint time;
 } bt_battery_app_data;
 
 /**