#include <dbus/dbus-glib.h>
#include <pthread.h>
#include <dbus/dbus.h>
+#include <stdint.h>
#include "bluetooth-api.h"
#include "bluetooth-hid-api.h"
#define DISCOVER_TIMEOUT 20
#define DISCOVER_CANCEL_INTERVAL 3
-#define PRT(format, args...) printf("%s:%d() "format, __FUNCTION__, __LINE__, ##args)
+#define PRT(format, args...) printf("%s:() "format, __FUNCTION__, ##args)
#define TC_PRT(format, args...) PRT(format"\n", ##args)
#define TC_PASS 1
};
+#if 0
#define tc_result(success, tc_index) \
TC_PRT("Test case [%d - %s] %s", tc_table[tc_index].tc_code, tc_table[tc_index].tc_name, ((success == TC_PASS) ? "Success" : "Failed"));
+#else
+#define tc_result(success, tc_index)
+#endif
bluetooth_device_info_t bond_dev;
int is_bond_device = FALSE;
int ret = 0;
int test_id;
+#ifdef ARCH64
+ test_id = find_tc_number((uintptr_t)data);
+#else
test_id = find_tc_number((int)data);
+#endif
+ if (test_id == -1)
+ return 0;
+
TC_PRT("TC : %s[%d]", tc_table[test_id].tc_name, tc_table[test_id].tc_code);
switch (tc_table[test_id].tc_code) {
break;
case 1:
- bluetooth_register_callback(bt_event_callback, NULL);
+ ret = bluetooth_register_callback(bt_event_callback, NULL);
if (ret < 0) {
TC_PRT("%s failed with [0x%04x]", tc_table[0].tc_name, ret);
tc_result(TC_FAIL, 1);
break;
case 2:
- bluetooth_unregister_callback();
+ ret = bluetooth_unregister_callback();
if (ret < 0) {
TC_PRT("%s failed with [0x%04x]", tc_table[1].tc_name, ret);
tc_result(TC_FAIL, 1);
static gboolean key_event_cb(GIOChannel * chan, GIOCondition cond , gpointer data)
{
- char buf[10] = {0};
+ char buf[49] = {0};
+#ifdef ARCH64
+ unsigned long len = 0;
+#else
unsigned int len = 0;
+#endif
int test_id;
memset(buf, 0, sizeof(buf));
test_id = atoi(buf);
- if (test_id)
- g_idle_add(test_input_callback, (void*)test_id);
+#ifdef ARCH64
+ g_idle_add(test_input_callback, (void *)(uintptr_t)test_id);
+#else
+ g_idle_add(test_input_callback, (void *)test_id);
+#endif
return TRUE;
}