bm_feature_data_h bm_data_handle = NULL;
GHashTable *gl_hash = NULL;
static struct bm_req_feature_data_handle_flag_s *bm_req_flag_h = NULL;
+const int mahp = 3600;
int battery_capacity = 500;
int gtimeo_id[2];
#endif /* DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN */
_DBG("update - app_usage for app_id(%s), for resource(%d), by usage(%d)", app_id, resource_id, app_usage);
+ //_DBG("session usage bt %d, wifi %d, cpu %d, dsp %d, dn %d", temp->rId_ble, temp->rId_wifi, temp->rId_cpu,
+ //temp->rId_display, temp->rId_device_network);
} else {
appid_usage_s *temp = (appid_usage_s *)calloc(1, sizeof(appid_usage_s));
if (temp == NULL) {
GHashTable *hash = g_hash_table_new_full(g_str_hash, g_str_equal, bm_data_free, bm_atm_st2_free);
long int edTime = 0, stTime = 0;
- int sesTime = 0, scTime = 0, conTime = 0, RX = 0, TX = 0, onTime = 0;
+ long int sesTime = 0, scTime = 0, conTime = 0, RX = 0, TX = 0;
+ double onTime = 0;
/* iterating over list for data accumulation */
for (bt_data_iterator = handle->bt_data_list; bt_data_iterator; bt_data_iterator = bt_data_iterator->next) {
bm_bluetooth_st *datalistnode = (bm_bluetooth_st *)(bt_data_iterator->data);
_DBG("received bt power params - idle[%d], scan[%d], connected[%d], rx[%d], tx[%d]",
sP_power_bt_idle, sP_power_bt_scan, sP_power_bt_conn, sP_power_bt_tx, sP_power_bt_rx);
/* BT power consumption Level - 1 at the Resource Level */
- int P_power_bt = 0, P_power_data = 0, P_power_conn = 0;
+ long int P_power_bt = 0, P_power_data = 0, P_power_conn = 0;
P_power_conn = ((sP_power_bt_idle) * (sesTime - (scTime + conTime))) + ((sP_power_bt_scan) * (scTime)) + ((sP_power_bt_conn) * (conTime));
P_power_data = ((sP_power_bt_tx) * TX) + ((sP_power_bt_rx) * RX);
P_power_bt = P_power_conn + P_power_data;
- _DBG("Calculated Power for Bluetooth P_power_bt(%d), P_power_conn (%d), P_power_data(%d)", P_power_bt, P_power_conn, P_power_data);
+ _DBG("Calculated Power for Bluetooth P_power_bt(%ld), P_power_conn (%ld), P_power_data(%ld)", P_power_bt, P_power_conn, P_power_data);
/* BT power consumption Level - 2 at the Application Level */
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, hash);
- int P_power_app_bt = 0, P_power_app_data = 0, P_power_app_conn = 0;
+ long int P_power_app_bt = 0, P_power_app_data = 0, P_power_app_conn = 0;
char *appid = NULL;
- int apprx = 0, apptx = 0, apptime = 0;
+ long int apprx = 0, apptx = 0;
+ double apptime = 0;
long int rx_t = 0, tx_t = 0;
long int ret_time = bm_get_log_time();
app_usage->rId_ble = P_power_app_bt;
app_usage->log_time = ret_time;
/* Call Insert Function */
- _DBG("Calculated Power for Appid(%s) - P_power_app_bt(%d), P_power_app_conn(%d), P_power_app_data(%d)",
+ _DBG("Calculated Power for Appid(%s) - P_power_app_bt(%ld), P_power_app_conn(%ld), P_power_app_data(%ld)",
appid, P_power_app_bt, P_power_app_conn, P_power_app_data);
if (mode) {
ret_val = bm_server_appid_insert_to_db(app_usage->AppId);
g_hash_table_destroy(hash);
/* Dump resource usage */
- _DBG("BLE usage : %d", RX + TX);
+ _DBG("BLE usage : %ld", RX + TX);
if (RX > 0 || TX > 0) {
history_item_s hi;
bd_print_history_item_reset(&hi);
GHashTable *hash = g_hash_table_new_full(g_str_hash, g_str_equal, bm_data_free, bm_atm_st2_free);
long int edTime = 0, stTime = 0;
- int sesTime = 0, scTime = 0, onTime = 0 /*applications*/, tl_total = 0;
- int tl0 = 0, tl1 = 0, tl2 = 0, tl3 = 0, tl4 = 0;
+ long int sesTime = 0, scTime = 0, tl_total = 0;
+ long int tl0 = 0, tl1 = 0, tl2 = 0, tl3 = 0, tl4 = 0;
+ double onTime = 0;
long int RX = 0, TX = 0;
/* iterating over list for data accumulation */
for (wifi_data_iterator = handle->wifi_data_list; wifi_data_iterator; wifi_data_iterator = wifi_data_iterator->next) {
idle[%d], rx[%d], tx[%d]", sP_power_wf_tl0, sP_power_wf_tl1, sP_power_wf_tl2, sP_power_wf_tl3,
sP_power_wf_tl4, sP_power_wf_scan, sP_power_wf_idle, sP_power_wf_rx, sP_power_wf_tx);
+ tl0 /= 1000; tl1 /= 1000; tl2 /= 1000; tl3 /= 1000; tl4 /= 1000;
+ scTime /= 1000; sesTime /= 1000; onTime /= 1000;
tl_total = tl0 + tl1 + tl2 + tl3 + tl4;
/* Wifi power consumption Level - 1 at the Resource Level */
- int P_power_wifi = 0; int P_power_data = 0; int P_power_conn = 0;
+ long int P_power_wifi = 0, P_power_data = 0, P_power_conn = 0;
P_power_conn = ((sP_power_wf_tl0 * tl0) + (sP_power_wf_tl1 * tl1) +
(sP_power_wf_tl2 * tl2) + (sP_power_wf_tl3 * tl3) +
(sP_power_wf_tl4 * tl4) + (sP_power_wf_scan * scTime) +
P_power_data = ((sP_power_wf_tx) * TX) + ((sP_power_wf_rx) * RX);
P_power_wifi = P_power_conn + P_power_data;
- _DBG("Calculated Power for Wifi P_power_wifi(%d), P_power_conn (%d), P_power_data(%d)", P_power_wifi, P_power_conn, P_power_data);
+ _DBG("Calculated Power for Wifi P_power_wifi(%ld), P_power_conn (%ld), P_power_data(%ld)", P_power_wifi, P_power_conn, P_power_data);
/* Wifi power consumption Level - 2 at the Application Level */
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, hash);
- int P_power_app_wifi = 0, P_power_app_data = 0, P_power_app_conn = 0;
+ long int P_power_app_wifi = 0, P_power_app_data = 0, P_power_app_conn = 0;
char *appid = NULL;
- int apprx = 0, apptx = 0, apptime = 0;
+ long int apprx = 0, apptx = 0;
+ double apptime = 0;
long int rx_t = 0, tx_t = 0;
long int ret_time = bm_get_log_time();
apprx = temp->rx; rx_t += apprx;
apptx = temp->tx; tx_t += apptx;
apptime = temp->time;
+ apptime /= 1000;
P_power_app_data = ((sP_power_wf_tx) * apptx) + ((sP_power_wf_rx) * apprx);
if (onTime != 0)
app_usage->rId_wifi = P_power_app_wifi;
app_usage->log_time = ret_time;
/* Call Insert Function */
- _DBG("Calculated Power for Appid(%s) - P_power_app_wifi(%d), P_power_app_conn(%d), P_power_app_data(%d)",
+ _DBG("Calculated Power for Appid(%s) - P_power_app_wifi(%ld), P_power_app_conn(%ld), P_power_app_data(%ld)",
appid, P_power_app_wifi, P_power_app_conn, P_power_app_data);
if (mode) {
/* creating hash-map with (key, value) = (app-id, data) */
GHashTable *hash = g_hash_table_new_full(g_str_hash, g_str_equal, bm_data_free, bm_atm_st1_free);
- int uTime = 0;
- int sTime = 0;
- int onTime = 0;
+ long int uTime = 0, sTime = 0;
+ double onTime = 0;
/* iterating over list for data accumulation */
for (cpu_data_iterator = handle->cpu_data_list; cpu_data_iterator; cpu_data_iterator = cpu_data_iterator->next) {
bm_cpu_st *datalistnode = (bm_cpu_st *)(cpu_data_iterator->data);
_DBG("received cpu power params - user[%d]\n, system[%d]\n", sP_power_cpu_user, sP_power_cpu_system);
/* CPU power consumption Level - 1 at the Resource Level */
- int P_power_cpu = 0, P_power_user = 0, P_power_system = 0;
+ long int P_power_cpu = 0, P_power_user = 0, P_power_system = 0;
+ _DBG("%ld %ld %lf", uTime, sTime, onTime);
+ uTime /= 1000; sTime /= 1000; onTime /= 1000;
P_power_user = ((sP_power_cpu_user * uTime));
P_power_system = ((sP_power_cpu_system * sTime));
P_power_cpu = P_power_user + P_power_system;
- _DBG("Calculated Power for CPU P_power_cpu (%d), P_power_user (%d), P_power_system (%d)", P_power_cpu, P_power_user, P_power_system);
+ _DBG("Calculated Power for CPU P_power_cpu (%ld), P_power_user (%ld), P_power_system (%ld)", P_power_cpu, P_power_user, P_power_system);
/* CPU power consumption Level - 2 at the Application Level */
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, hash);
- int P_power_app_cpu = 0, P_power_app_use = 0;
+ long int P_power_app_cpu = 0, P_power_app_use = 0;
+ double apptime = 0;
char *appid = NULL;
- int apptime = 0;
long int ret_time = bm_get_log_time();
appid_usage_s *app_usage = (appid_usage_s *)calloc(1, sizeof(appid_usage_s));
apptime = 0;
app_time_map_st1 *temp = (app_time_map_st1 *)value;
appid = temp->app_id;
- apptime = temp->time;
+ apptime = (temp->time);
+ apptime /= 1000;
if (onTime != 0)
P_power_app_use = (P_power_cpu * apptime)/onTime; //check for 0 denominator & same units
P_power_app_cpu = P_power_app_use;
app_usage->rId_cpu = P_power_app_cpu;
app_usage->log_time = ret_time;
/* Call Insert Function */
- _DBG("Calculated Power for Appid (%s) P_power_app_cpu (%d), P_power_app_use (%d)", appid, P_power_app_cpu, P_power_app_use);
+ _DBG("Calculated Power for Appid (%s) P_power_app_cpu (%ld), P_power_app_use (%ld)", appid, P_power_app_cpu, P_power_app_use);
if (mode) {
ret_val = bm_server_appid_insert_to_db(app_usage->AppId);
/* creating hash-map with (key, value) = (app-id, data) */
GHashTable *hash = g_hash_table_new_full(g_str_hash, g_str_equal, bm_data_free, bm_atm_st1_free);
- long int edTime = 0;
- long int stTime = 0;
- int sesTime = 0, onTime = 0;
- int highTime = 0, medTime = 0, lowTime = 0;
+ long int edTime = 0, stTime = 0, sesTime = 0;
+ long int highTime = 0, medTime = 0, lowTime = 0;
+ double onTime = 0;
/* iterating over list for data accumulation */
for (dp_data_iterator = handle->display_list; dp_data_iterator; dp_data_iterator = dp_data_iterator->next) {
bm_display_st *datalistnode = (bm_display_st *)(dp_data_iterator->data);
_DBG("received display power params - high[%d], medium[%d], low[%d]", sP_power_dp_high, sP_power_dp_med, sP_power_dp_low);
/* Display power consumption Level - 1 at the Resource Level */
- int P_power_disp = 0, P_power_on = 0;
- P_power_on = ((sP_power_dp_low * lowTime) + (sP_power_dp_med * medTime) * (sP_power_dp_high * highTime));
+ lowTime /= 1000; medTime /= 1000; highTime /= 1000; onTime /= 1000;
+ long int P_power_disp = 0, P_power_on = 0;
+ _DBG("Total Time in s low %ld med %ld high %ld session %ld onTime %lf", lowTime, medTime, highTime, sesTime, onTime);
+ P_power_on = ((sP_power_dp_low * lowTime) + (sP_power_dp_med * medTime) + (sP_power_dp_high * highTime));
P_power_disp = P_power_on;
- _DBG("Calculated Power for Display P_power_disp (%d), P_power_on (%d)", P_power_disp, P_power_on);
+ _DBG("Calculated Power for Display P_power_disp (%ld), P_power_on (%ld)", P_power_disp, P_power_on);
/* Display power consumption Level - 2 at the Application Level */
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, hash);
- int P_power_app_disp = 0, P_power_app_on = 0;
+ long int P_power_app_disp = 0, P_power_app_on = 0;
char *appid = NULL;
- int apptime = 0;
+ double apptime = 0;
long int ret_time = bm_get_log_time();
appid_usage_s *app_usage = (appid_usage_s *)calloc(1, sizeof(appid_usage_s));
app_time_map_st1 *temp = (app_time_map_st1 *)value;
appid = temp->app_id;
apptime = temp->time;
-
+ apptime /= 1000;
if (onTime != 0)
P_power_app_on = (P_power_on * apptime)/onTime; //check for 0 denominator & same units
P_power_app_disp = P_power_app_on;
app_usage->rId_display = P_power_app_disp;
app_usage->log_time = ret_time;
/* Call Insert Function */
- _DBG("Calculated Power for Appid (%s) P_power_app_disp(%d), P_power_app_on (%d)", appid, P_power_app_disp, P_power_app_on);
+ _DBG("Calculated Power for Appid (%s) P_power_app_disp(%ld), P_power_app_on (%ld)", appid, P_power_app_disp, P_power_app_on);
if (mode) {
ret_val = bm_server_appid_insert_to_db(app_usage->AppId);
if (ret_val != BATTERY_MONITOR_ERROR_NONE)
return BATTERY_MONITOR_ERROR_OUT_OF_MEMORY;
}
- gbr_st->time_s = ret_time; gbr_st->dark = BATTERY_MONITOR_GET_DATA_JOB_PERIOD;
+ gbr_st->time_s = ret_time; gbr_st->dark = (BATTERY_MONITOR_GET_DATA_JOB_PERIOD/1000);
gbr_st->dark -= sesTime; gbr_st->dim = lowTime; gbr_st->medium = medTime;
gbr_st->bright = highTime;
/* creating hash-map with (key, value) = (app-id, data) */
GHashTable *hash = g_hash_table_new_full(g_str_hash, g_str_equal, bm_data_free, bm_atm_st2_free);
- int tl0 = 0, tl1 = 0, tl2 = 0, tl3 = 0, tl4 = 0, tl5 = 0, tl6 = 0;
- long int RX = 0, TX = 0, tl_total = 0;
+ long int tl0 = 0, tl1 = 0, tl2 = 0, tl3 = 0, tl4 = 0, tl5 = 0, tl6 = 0;
+ long int RX = 0, TX = 0;
+ double tl_total = 0;
/* iterating over list for data accumulation */
for (dn_data_iterator = handle->dn_data_list; dn_data_iterator; dn_data_iterator = dn_data_iterator->next) {
bm_device_network_st *datalistnode = (bm_device_network_st *)(dn_data_iterator->data);
sP_power_dn_tl0, sP_power_dn_tl1, sP_power_dn_tl2, sP_power_dn_tl3, sP_power_dn_tl4, sP_power_dn_tl5,
sP_power_dn_tl6, sP_power_dn_rx, sP_power_dn_tx);
+ tl0 /= 1000; tl1 /= 1000; tl2 /= 1000; tl3 /= 1000; tl4 /= 1000; tl5 /= 1000; tl6 /= 1000;
tl_total = tl0 + tl1 + tl2 + tl3 + tl4 + tl5 + tl6;
/* Device Network power consumption Level - 1 at the Resource Level */
- int P_power_dntw = 0, P_power_data = 0, P_power_conn = 0;
+ long int P_power_dntw = 0, P_power_data = 0, P_power_conn = 0;
P_power_conn = ((sP_power_dn_tl0 * tl0) + (sP_power_dn_tl1 * tl1) + (sP_power_dn_tl2 * tl2) + (sP_power_dn_tl3 * tl3) + (sP_power_dn_tl4 * tl4) + (sP_power_dn_tl5 * tl5) + (sP_power_dn_tl6 * tl6));
P_power_data = ((sP_power_dn_tx) * TX) + ((sP_power_dn_rx) * RX);
P_power_dntw = P_power_conn + P_power_data;
- _DBG("Calculated Power for Device Network P_power_ntw(%d), P_power_conn (%d), P_power_data(%d)", P_power_dntw, P_power_conn, P_power_data);
+ _DBG("Calculated Power for Device Network P_power_ntw(%ld), P_power_conn (%ld), P_power_data(%ld)", P_power_dntw, P_power_conn, P_power_data);
/* Device Network power consumption Level - 2 at the Application Level */
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, hash);
- int P_power_app_dntw = 0, P_power_app_data = 0, P_power_app_conn = 0;
+ long int P_power_app_dntw = 0, P_power_app_data = 0, P_power_app_conn = 0;
char *appid = NULL;
- int apprx = 0, apptx = 0, apptime = 0;
+ long int apprx = 0, apptx = 0;
+ double apptime = 0;
long int ret_time = bm_get_log_time();
appid_usage_s *app_usage = (appid_usage_s *)calloc(1, sizeof(appid_usage_s));
apprx = 0, apptx = 0, apptime = 0;
app_time_map_st2 *temp = (app_time_map_st2 *)value;
appid = temp->app_id;
- apprx = temp->rx;
- apptx = temp->tx;
- apptime = temp->time;
+ apprx = temp->rx; apptx = temp->tx;
+ apptime = temp->time; apptime /= 1000;
P_power_app_data = ((sP_power_dn_tx) * apptx) + ((sP_power_dn_rx) * apprx);
if (tl_total != 0)
P_power_app_conn = (P_power_conn * apptime)/tl_total; //check for 0 denominator & same units
app_usage->rId_device_network = P_power_app_dntw;
app_usage->log_time = ret_time;
/* Call Insert Function */
- _DBG("Calculated Power for Appid (%s) P_power_app_dntw(%d), P_power_app_conn (%d), P_power_app_data(%d)", appid, P_power_app_dntw, P_power_app_conn, P_power_app_data);
+ _DBG("Calculated Power for Appid (%s) P_power_app_dntw(%ld), P_power_app_conn (%ld), P_power_app_data(%ld)", appid, P_power_app_dntw, P_power_app_conn, P_power_app_data);
if (mode) {
ret_val = bm_server_appid_insert_to_db(app_usage->AppId);
if (ret_val != BATTERY_MONITOR_ERROR_NONE)
_ERR("Global Hash creation failed");
/* parsing ble data */
- if (bm_data_handle->bm_ble_handle != NULL &&
- bm_req_flag_h->req_ble_data) {
-
+ if (bm_data_handle->bm_ble_handle != NULL && bm_req_flag_h->req_ble_data) {
_DBG("parsing ble data");
-
ret_val = bm_ble_calc_power_and_commit(bm_data_handle->bm_ble_handle, mode);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "ble power cal failure");
-
} else {
_DBG("set ble flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_BLE, true);
}
-
_DBG("completed ble data request");
/* parsing wifi data */
- if (bm_data_handle->bm_wifi_handle != NULL &&
- bm_req_flag_h->req_wifi_data) {
-
+ if (bm_data_handle->bm_wifi_handle != NULL && bm_req_flag_h->req_wifi_data) {
_DBG("parsing wifi data");
-
ret_val = bm_wifi_calc_power_and_commit(bm_data_handle->bm_wifi_handle, mode);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "wifi power calc failure");
} else {
_DBG("set wifi flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_WIFI, true);
}
-
_DBG("completed wifi data request");
/* parsing cpu data */
- if (bm_data_handle->bm_cpu_handle != NULL &&
- bm_req_flag_h->req_cpu_data) {
-
+ if (bm_data_handle->bm_cpu_handle != NULL && bm_req_flag_h->req_cpu_data) {
_DBG("parsing cpu data");
-
ret_val = bm_cpu_calc_power_and_commit(bm_data_handle->bm_cpu_handle, mode);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "cpu power calc failure");
} else {
_DBG("set cpu flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_CPU, true);
}
-
_DBG("completed cpu data request");
/* parsing display data */
- if (bm_data_handle->bm_display_handle != NULL &&
- bm_req_flag_h->req_dp_data) {
-
+ if (bm_data_handle->bm_display_handle != NULL && bm_req_flag_h->req_dp_data) {
_DBG("parsing display data");
-
ret_val = bm_display_calc_power_and_commit(bm_data_handle->bm_display_handle, mode);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "display power calc failure");
} else {
_DBG("set display flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_DISPLAY, true);
}
-
_DBG("completed display data request");
/* parsing device-network data */
- if (bm_data_handle->bm_dn_handle != NULL &&
- bm_req_flag_h->req_dn_data) {
-
+ if (bm_data_handle->bm_dn_handle != NULL && bm_req_flag_h->req_dn_data) {
_DBG("parsing device-network data");
-
ret_val = bm_device_network_calc_power_and_commit(bm_data_handle->bm_dn_handle, mode);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "device-network power calc failure");
} else {
_DBG("set device-network flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_DEVICE_NETWORK, true);
}
-
_DBG("completed device-network data request");
#ifdef DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN
/* parsing gps data */
- if (bm_data_handle->bm_gps_handle != NULL &&
- bm_req_flag_h->req_gps_data) {
-
+ if (bm_data_handle->bm_gps_handle != NULL && bm_req_flag_h->req_gps_data) {
_DBG("parsing gps data");
-
ret_val = bm_gps_calc_power_and_commit(bm_data_handle->bm_gps_handle);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "gps-sensor power calc failure");
} else {
_DBG("set gps-sensor flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_GPS_SENSOR, true);
}
-
_DBG("completed gps data request");
/* parsing hrm data */
- if (bm_data_handle->bm_hrm_handle != NULL &&
- bm_req_flag_h->req_hrm_data) {
-
+ if (bm_data_handle->bm_hrm_handle != NULL && bm_req_flag_h->req_hrm_data) {
_DBG("parsing hrm data");
-
ret_val = bm_hrm_calc_power_and_commit(bm_data_handle->bm_hrm_handle);
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "hrm-sensor power calc failure");
} else {
_DBG("set hrm-sensor flag - true");
bm_engine_set_req_flag_handle(BM_PLUGIN_ID_HRM_SENSOR, true);
}
-#endif /* DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN */
_DBG("completed hrm data request");
+#endif /* DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN */
/* parsing battery data */
-
_DBG("parsing battery data");
-
ret_val = bm_battery_calc_power_and_commit();
-
BM_CHECK_VAL((ret_val == BATTERY_MONITOR_ERROR_NONE), "battery power calc failure");
-
_DBG("completed battery data request");
ret_val = bm_insert_appid_session_usage_to_db();
ret_val = bm_get_battery_power_params(&battery_capacity);
if (ret_val != BATTERY_MONITOR_ERROR_NONE)
_ERR("unable ro read battery capacity");
+ battery_capacity *= mahp; //Battery Capacity in mAs
EXIT;
return ret_val;