From 73800f87eb0feb3d65134a5c460a4ce58b8896f7 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Tue, 23 Oct 2012 11:19:09 -0700 Subject: [PATCH] implemented fake battery data --- device-manager-plugin-ivi.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/device-manager-plugin-ivi.c b/device-manager-plugin-ivi.c index 191337f..41c4e6b 100644 --- a/device-manager-plugin-ivi.c +++ b/device-manager-plugin-ivi.c @@ -120,7 +120,9 @@ int OEM_sys_get_battery_present(int *value) { int ret = -1; - ret = sys_get_int(BATTERY_PRESENT_PATH, value); + *value = 1; + ret = 0; +// ret = sys_get_int(BATTERY_PRESENT_PATH, value); DBG("path[%s], value[%d]", BATTERY_PRESENT_PATH, *value); return ret; @@ -133,9 +135,9 @@ int OEM_sys_get_battery_capacity(int *value) static int charge_full = 0; static int unit = 0; int charge_now; - int capacity = 0; + int capacity = 100; - if(charge_full == 0) + /*if(charge_full == 0) { ret = sys_get_int(BATTERY_CHARGE_FULL_PATH, &charge_full); if(ret != 0) @@ -155,6 +157,7 @@ int OEM_sys_get_battery_capacity(int *value) } DEVIDE(charge_now, unit, capacity); + */ *value = capacity; DBG("battery capacity value[%d]", *value); @@ -185,10 +188,10 @@ int OEM_sys_get_battery_charge_full(int *value) int OEM_sys_get_battery_charge_now(int *value) { char* buf = NULL; - int ret = -1; + int ret = 0; int len = strlen("Charging\n"); - buf = sys_get_str(BATTERY_CHARGE_STATUS_PATH); +/* buf = sys_get_str(BATTERY_CHARGE_STATUS_PATH); if(buf){ if(0 == strncmp(buf, "Charging\n", len )){ @@ -200,7 +203,9 @@ int OEM_sys_get_battery_charge_now(int *value) free(buf); ret = 0; - } + }*/ + + *value = 1; return ret; } @@ -310,11 +315,11 @@ static const OEM_sys_devman_plugin_interface devman_plugin_interface_pinetrail OEM_sys_set_null_1, //int (*OEM_sys_set_haptic_vibetones_enable) (int value); OEM_sys_set_null_1, //int (*OEM_sys_set_haptic_vibetones_oneshot) (int value); - OEM_sys_get_null_1, //int (*OEM_sys_get_battery_capacity) (int *value); + OEM_sys_get_battery_capacity, //int (*OEM_sys_get_battery_capacity) (int *value); OEM_sys_get_null_1, //int (*OEM_sys_get_battery_capacity_raw) (int *value); - OEM_sys_get_null_1, //int (*OEM_sys_get_battery_charge_full) (int *value); - OEM_sys_get_null_1, //int (*OEM_sys_get_battery_charge_now) (int *value); - OEM_sys_get_null_1, //int (*OEM_sys_get_battery_present) (int *value); + OEM_sys_get_battery_charge_full, //int (*OEM_sys_get_battery_charge_full) (int *value); + OEM_sys_get_battery_charge_now, //int (*OEM_sys_get_battery_charge_now) (int *value); + OEM_sys_get_battery_present, //int (*OEM_sys_get_battery_present) (int *value); OEM_sys_get_null_1, //int (*OEM_sys_get_battery_health) (int *value); OEM_sys_get_null_1, //int (*OEM_sys_get_battery_polling_required) (int *value); -- 2.7.4