Turn on the Android BlueZ Debug switch:
Enable incluthd debugging
Way1:
In file external/bluetooth/bluez/src/log. h
Redefine DBG as follow:
1)
# Define DBG (fmt, arg...) _ android_log_print (ANDROID_LOG_DEBUG, "BlueZ", fmt, # arg)
2)
Add file as header in log. h:
# Include <android/log. h>
3)
Void _ btd_toggle_debug ()
{
Struct btd_debug_desc * desc;
// For (desc = _ start ___ debug; desc <_ stop ___ debug; desc ++)
// Desc-> flags | = BTD_DEBUG_FLAG_PRINT;
}
Void _ btd_log_init (const char * debug, int detach)
{
Int option = LOG_NDELAY | LOG_PID;
Struct btd_debug_desc * desc;
Const char * name = NULL, * file = NULL;
If (debug! = NULL)
Enabled = g_strsplit_set (debug, ":,", 0 );
/*
For (desc = _ start ___ debug; desc <_ stop ___ debug; desc ++ ){
If (file! = NULL | name! = NULL ){
If (g_strcmp0 (desc-> file, file) = 0 ){
If (desc-> name = NULL)
Desc-> name = name;
} Else
File = NULL;
}
If (is_enabled (desc ))
Desc-> flags | = BTD_DEBUG_FLAG_PRINT;
}
*/
Way 2:
In file external/bluetooth/bluez/src/log. h:
1.
Add
# Include <cutils/logd. h>
2.
Before:
# Define BTD_DEBUG_FLAG_DEFAULT (0)
# Define BTD_DEBUG_FLAG_PRINT (1 <0)
After
# Define BTD_DEBUG_FLAG_DEFAULT 1
# Define BTD_DEBUG_FLAG_PRINT 1
3.
Before:
# Define DBG (fmt, arg...) do {\
Static struct btd_debug_desc _ btd_debug_desc \
_ Attribute _ (used, section ("_ debug"), aligned (8) = {\
. File = _ FILE __,. flags = BTD_DEBUG_FLAG_DEFAULT ,\
};\
If (_ btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT )\
Btd_debug ("% s: % s ()" fmt, _ FILE __, _ FUNCTION _, # arg );\
} While (0) www.2cto.com
After:
# Define DBG (fmt, arg...) do {\
Static struct btd_debug_desc _ btd_debug_desc \
_ Attribute _ (used, section ("_ debug"), aligned (8) = {\
. File = _ FILE __,. flags = BTD_DEBUG_FLAG_DEFAULT ,\
};\
If (_ btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT )\
_ Android_log_print (ANDROID_LOG_DEBUG, "BlueZ", fmt, # arg );\
} While (0)
End.
By saturnbj