Merge "Add time member to app info structure for battery monitor plugin" into tizen
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / include / bt-service-battery-monitor.h
1  /*Bluetooth-frwk
2  *
3  * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
4  *
5  * Contact:  Sudipto Bal <sudipto.bal@samsung.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *              http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 #ifndef _BT_SERVICE_BATTERY_MONITOR_H_
22 #define _BT_SERVICE_BATTERY_MONITOR_H_
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #include <stdint.h>
29 #include <oal-event.h>
30 #include <unistd.h>
31 #include <sys/types.h>
32
33 typedef struct {
34         uid_t uid;
35         pid_t pid;
36         uint16_t rx_bytes;
37         uint16_t tx_bytes;
38         uint time;
39 } _bt_battery_app_data_t;
40
41 typedef struct {
42         time_t session_start_time;
43         time_t session_end_time;
44         uint16_t session_connected_time;
45         uint16_t session_scan_time;
46         GSList *atm_list;
47 } _bt_battery_data_t;
48
49 typedef enum {
50         RX_DATA,
51         TX_DATA
52 } data_transaction_type_e;
53
54 void _bt_bm_event_handler(gpointer data);
55
56 int _bt_bm_read_data(_bt_battery_data_t *data);
57
58 void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, int size, data_transaction_type_e type);
59
60 #ifdef __cplusplus
61 }
62 #endif /* __cplusplus */
63 #endif /* _BT_SERVICE_BATTERY_MONITOR_H_ */