Add CPU stats for Battery Dump
[platform/core/system/batterymonitor.git] / include / bd_private.h
1 /*
2  *  Battery-Monitor Dump
3  *
4  * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __BD_PRIVATE_H__
21 #define __BD_PRIVATE_H__
22
23 #include <stdlib.h>
24
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29
30 /* Battery Dump db structures */
31 typedef struct _gbl_ble_stat_s {
32         long int time_s;
33         long int ble_idle_time;
34         long int ble_rx_time;
35         long int ble_tx_time;
36         long int ble_pwi_val;
37 } bd_gl_ble_stat_s;
38
39 typedef struct _gbl_wifi_stat_s {
40         long int time_s;
41         long int wifi_on_time;
42         long int wifi_conn_time;
43         long int wifi_idle_time;
44         long int wifi_rx_time;
45         long int wifi_tx_time;
46         long int wifi_pwi_val;
47 } bd_gl_wifi_stat_s;
48
49 typedef struct _gbl_ntw_stat_s {
50         long int time_s;
51         long int dn_rx_byt;
52         long int dn_tx_byt;
53         long int wifi_rx_byt;
54         long int wifi_tx_byt;
55         long int dn_rx_pkt;
56         long int dn_tx_pkt;
57         long int wifi_rx_pkt;
58         long int wifi_tx_pkt;
59         long int bt_rx_byt;
60         long int bt_tx_byt;
61 } bd_gl_ntw_stat_s;
62
63 typedef struct _gbl_sbr_stat_s {
64         long int time_s;
65         long int dark; //OFF
66         long int dim; // All are time values
67         long int medium;
68         long int light; //DEF: 0
69         long int bright;
70 } bd_gl_sbr_stat_s;
71
72 typedef struct _gbl_sig_stat_s {
73         long int time_s;
74         long int scan_time;
75         long int none_time;
76         long int poor_time;
77         long int med_time;
78         long int good_time;
79         long int grt_time;
80 } bd_gl_sgt_stat_s;
81
82 typedef struct _gbl_wst_stat_s {
83         long int time_s;
84         long int wscan_time;
85         long int wnone_time;
86         long int wpoor_time;
87         long int wmed_time;
88         long int wgood_time;
89         long int wgrt_time;
90 } bd_gl_wst_stat_s;
91
92 typedef struct _gbl_bst_stat_s {
93         long int time_s;
94         long int off_time;
95         long int low_time;
96         long int med_time;
97         long int high_time;
98 } bd_gl_bst_stat_s;
99
100 typedef struct _gbl_cpu_stat_s {
101         long int time_s;
102         long int usr_time;
103         long int sys_time;
104 } bd_gl_cpu_stat_s;
105
106 /*
107 typedef struct _unt_ntw_stat_s {
108         long int time_s;
109         char *appid;
110         long int dn_rx_byt;
111         long int dn_tx_byt;
112         long int wifi_rx_byt;
113         long int wifi_tx_byt;
114         long int bt_rx_byt;
115         long int bt_tx_byt;
116         long int app_rt;
117 } bd_ul_ntw_stat_s;
118 */
119
120 /* Battery Dump db enumerations */
121 typedef enum {
122         BD_GBLESTAT_NONE = -1,
123         BD_GBLESTAT_IDLE,
124         BD_GBLESTAT_RX,
125         BD_GBLESTAT_TX,
126         BD_GBLESTAT_PWI_VAL,
127 } BD_GBLESTAT_DB_IDX;
128
129 typedef enum {
130         BD_GWFLSTAT_NONE = -1,
131         BD_GWFLSTAT_ON,
132         BD_GWFLSTAT_CON,
133         BD_GWFLSTAT_IDLE,
134         BD_GWFLSTAT_RX,
135         BD_GWFLSTAT_TX,
136         BD_GWFLSTAT_PWI_VAL,
137 } BD_GWFLSTAT_DB_IDX;
138
139 typedef enum {
140         BD_GNTWSTAT_NONE = -1,
141         BD_GNTWSTAT_DN_RXB,
142         BD_GNTWSTAT_DN_TXB,
143         BD_GNTWSTAT_WIFI_RXB,
144         BD_GNTWSTAT_WIFI_TXB,
145         BD_GNTWSTAT_DN_RXP,
146         BD_GNTWSTAT_DN_TXP,
147         BD_GNTWSTAT_WIFI_RXP,
148         BD_GNTWSTAT_WIFI_TXP,
149         BD_GNTWSTAT_BT_RXB,
150         BD_GNTWSTAT_BT_TXB,
151 } BD_GNTWSTAT_DB_IDX;
152
153 typedef enum {
154         BD_GSBRSTAT_NONE = -1,
155         BD_GSBRSTAT_DARK,
156         BD_GSBRSTAT_DIM,
157         BD_GSBRSTAT_MEDIUM,
158         BD_GSBRSTAT_LIGHT,
159         BD_GSBRSTAT_BRIGHT,
160 } BD_GSBRSTAT_DB_IDX;
161
162 typedef enum {
163         BD_GSGTSTAT_NONE = -1,
164         BD_GSGTSTAT_SCAN,
165         BD_GSGTSTAT_NO,
166         BD_GSGTSTAT_POOR,
167         BD_GSGTSTAT_MED,
168         BD_GSGTSTAT_GOOD,
169         BD_GSGTSTAT_GRT,
170 } BD_GSGTSTAT_DB_IDX;
171
172 typedef enum {
173         BD_GBSTSTAT_NONE = -1,
174         BD_GBSTSTAT_OFF,
175         BD_GBSTSTAT_LOW,
176         BD_GBSTSTAT_MED,
177         BD_GBSTSTAT_HIGH,
178 } BD_GBSTSTAT_DB_IDX;
179
180 typedef enum {
181         BD_GCPUSTAT_NONE = -1,
182         BD_GCPUSTAT_USR,
183         BD_GCPUSTAT_SYS,
184 } BD_GCPUSTAT_DB_IDX;
185
186 /*
187 typedef enum {
188         BD_UNTWSTAT_NONE = -1,
189         BD_UNTWSTAT_APP,
190         BD_UNTWSTAT_DN_RXB,
191         BD_UNTWSTAT_DN_TXB,
192         BD_UNTWSTAT_WIFI_RXB,
193         BD_UNTWSTAT_WIFI_TXB,
194         BD_UNTWSTAT_RT,
195 } BD_UNTWSTAT_DB_IDX;
196 */
197
198 /* Battery Specific Enumeration */
199 typedef enum {
200         BD_BSTA_NONE = -1,
201         BD_BSTA_INVD,
202         BD_BSTA_UNKN,
203         BD_BSTA_CHAR,
204         BD_BSTA_DISC,
205         BD_BSTA_NCHA,
206         BD_BSTA_FULL,
207 } BD_BSTA_IDX; //B Status
208
209 typedef enum {
210         BD_BHLT_NONE = -1,
211         BD_BHLT_INVD,
212         BD_BHLT_GOOD,
213         BD_BHLT_UNKN,
214         BD_BHLT_OVRH,
215         BD_BHLT_DEAD,
216         BD_BHLT_OVRV,
217         BD_BHLT_UNSP,
218         BD_BHLT_CLD,
219 } BD_BHLT_IDX;//B Health
220
221 typedef enum {
222         BD_BPLT_NONE = -1,
223         BD_BPLT_DIS,
224         BD_BPLT_AC,
225         BD_BPLT_USB,
226         BD_BPLT_WL,
227 } BD_BPLT_IDX;//B PlugT
228
229 #ifdef __cplusplus
230 }
231 #endif
232
233 #endif /* __BD_PRIVATE_H__*/