Remove old bt-service files
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / 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         uint32_t rx_bytes;
37         uint32_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         uint32_t tx_time;
45         uint32_t rx_time;
46         uint32_t idle_time;
47         uint32_t session_connected_time;
48         uint32_t session_scan_time;
49         GSList *atm_list;
50 } _bt_battery_data_t;
51
52 typedef enum {
53         SCAN_REGACY = 0x00,
54         SCAN_LE,
55         SCAN_BOTH
56 } bt_bm_scan_type_e;
57
58 typedef struct {
59         bt_bm_scan_type_e type;
60         uid_t uid;
61         pid_t pid;
62 } bt_bm_scan_info_t;
63
64 typedef enum {
65         RX_DATA,
66         TX_DATA,
67         TIME_DATA
68 } data_transaction_type_e;
69
70 void _bt_bm_event_handler(gpointer data);
71
72 int _bt_bm_read_data(_bt_battery_data_t *data);
73
74 void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, unsigned int size, data_transaction_type_e type);
75
76 void _bt_bm_add_scan_app(bt_bm_scan_type_e type, uid_t uid, pid_t pid);
77
78 void _bt_bm_remove_scan_app(bt_bm_scan_type_e type, uid_t uid, pid_t pid);
79
80 void _bt_start_connect_time(void);
81
82 void _bt_stop_connect_time(void);
83
84 #ifdef __cplusplus
85 }
86 #endif /* __cplusplus */
87 #endif /* _BT_SERVICE_BATTERY_MONITOR_H_ */