#include "bm_server_db.h"
#include "bm_private.h"
#include "bd_private.h"
-/* For Test Purpose Only */
+
+#ifdef DUMP_DUMMY
#include "bd_history_item_dummy.h"
+#endif
dump_data_s history_data[HISTORY_SIZE_MAX];
int h_count = 0; int h_flag = false;
}
*/
-/*// remove this
-static int bd_test_fn()
-{
- ENTER;
-
- history_item_s ts;
-
- bd_print_history_item_reset(&ts);
- ts.cmd_s = CM_CRR_TIME; ts.event_code = ET_NONE;
- ts.event_tag = NULL; ts.wakelock_tag = NULL;
- ts.wakereason_tag = NULL;
- bd_set_history_from_listener(&ts);
-
- ts.cmd_s = CM_UPD; ts.time_s = 0;
- ts.time_current = 0;
- ts.state_1 = 0;
- ts.state_1 = ST1_WIFI_SCAN_FLAG;
- ts.state_1 |= (ST1_SCREEN_ON_FLAG);
- ts.state_2 = ST2_VIDEO_ON_FLAG;
- ts.battery_level = 99;
- ts.battery_status = 'd';
- ts.battery_health = 'g';
- ts.battery_plugtype = 'a';
- ts.battery_temperature = 226;
- ts.battery_voltage = 400;
- ts.battery_charge = 0;
- ts.event_code = ET_PROC; //Dummy Event
- ts.event_tag = (history_tag_s *)calloc(1, sizeof(history_tag_s));
- if (ts.event_tag != NULL) {
- _DBG("Memory created successfully");
- GString *temp = ts.event_tag->string_info;
- temp = g_string_sized_new(30);
- BM_CHECK_MEM_ALLOC(temp, {});
- ts.event_tag->uid = 0;
- ts.event_tag->sp_idx = 1;
- temp = g_string_append(temp, "tizen");
- ts.event_tag->string_info = temp;
- _DBG("%s _1", ts.event_tag->string_info->str);
- }
- ts.wakelock_tag = NULL;
- ts.wakereason_tag = NULL;
- // Node 1
- bd_set_history_from_listener(&ts);
-
- ts.event_code = ET_NONE;
- ts.event_tag = NULL;
- ts.state_1 &= ~(ST1_WIFI_SCAN_FLAG);
- // Node 2
- bd_set_history_from_listener(&ts);
-
- EXIT;
- return BATTERY_MONITOR_ERROR_NONE;
-}*/
-
-/*
-static int bd_make_string_maps()
-{
- ENTER;
-
- bd_test_fn();
- history_item_s ts;
- for (int i = 0; i < h_count; i++)
- bd_get_history_detail_from_dump(i, &ts);
- bd_print_history_item_main(0, 1576753138, true);
-
- EXIT;
- return BATTERY_MONITOR_ERROR_NONE;
-}*/
-
static int *dumpsys_handler;
int bd_callback(const int fd, const int argc, char **argv)
h_count = 0; h_flag = true;
_INFO("Battery Dump Init Successful");
- //Remove
- // Uncomment to test
+
+#ifdef DUMP_DUMMY
bd_dummy_test_fn();
+#endif
EXIT;
return BATTERY_MONITOR_ERROR_NONE;