#include "bt-request-sender.h"
#include "bt-event-handler.h"
+/* Avoid the build error related to vconf.h's dependency */
+#ifndef VCONFKEY_BATTERY_MONITOR_STATUS
+#define VCONFKEY_BATTERY_MONITOR_STATUS "db/bluetooth/bmstatus"
+#endif
+
static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
{
int i;
return result;
}
-BT_EXPORT_API void bluetooth_set_battery_monitor_state(bool state)
+BT_EXPORT_API int bluetooth_set_battery_monitor_state(bool state)
{
BT_INFO("Setting vconf key");
- if (vconf_set_int(VCONFKEY_BATTERY_MONITOR_STATUS, state) != 0)
- BT_ERR("vconf_set_int failed");
+ if (vconf_set_bool(VCONFKEY_BATTERY_MONITOR_STATUS, state) != 0)
+ {
+ BT_ERR("vconf_set_bool failed");
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+ return BLUETOOTH_ERROR_NONE;
}
-BT_EXPORT_API bool bluetooth_get_battery_monitor_state()
+BT_EXPORT_API int bluetooth_get_battery_monitor_state()
{
- int state=0;
+ int state = 0;
BT_INFO("Getting vconf key value");
- if (vconf_get_int(VCONFKEY_BATTERY_MONITOR_STATUS, &state) != 0)
- BT_ERR("vconf_get_int failed");
+ if (vconf_get_bool(VCONFKEY_BATTERY_MONITOR_STATUS, &state) != 0)
+ BT_ERR("vconf_get_bool failed");
return state;
}
if (result != BLUETOOTH_ERROR_NONE) {
BT_ERR("Error encountered");
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return result;
}
BT_DBG("App-wise data transaction details:");
for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
bt_battery_app_data *t = (bt_battery_app_data *)(l->data);
- BT_DBG("%ld %ld %d %d", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes);
+ BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
}
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);