Provide RFCOMM data to battery monitor frwk
[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 } _bt_battery_app_data_t;
39
40 typedef struct {
41         time_t session_start_time;
42         time_t session_end_time;
43         uint16_t session_connected_time;
44         uint16_t session_scan_time;
45         GSList *atm_list;
46 } _bt_battery_data_t;
47
48 typedef enum {
49         RX_DATA,
50         TX_DATA
51 } data_transaction_type_e;
52
53 void _bt_bm_event_handler(gpointer data);
54
55 int _bt_bm_read_data(_bt_battery_data_t *data);
56
57 void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, int size, data_transaction_type_e type);
58
59 #ifdef __cplusplus
60 }
61 #endif /* __cplusplus */
62 #endif /* _BT_SERVICE_BATTERY_MONITOR_H_ */