diff --git a/src/Makefile.in b/src/Makefile.in index 656d15809..a8f16d194 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -42,7 +42,7 @@ libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) ranlib $@ BTdaemon: $(BTdaemon_SOURCES) - $(CC) $(CPPFLAGS) -o $@ $(BTdaemon_SOURCES) $(LDFLAGS) + $(CC) $(CPPFLAGS) -DHAVE_HCI_DUMP -o $@ $(BTdaemon_SOURCES) $(LDFLAGS) @USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@ clean: diff --git a/src/debug.h b/src/debug.h index 6ae913e3c..607f6f4d7 100644 --- a/src/debug.h +++ b/src/debug.h @@ -36,23 +36,36 @@ */ #include "config.h" +#include "hci_dump.h" #include #ifdef ENABLE_LOG_DEBUG +#ifdef HAVE_HCI_DUMP +#define log_debug(format, ...) hci_dump_log(format, ## __VA_ARGS__) +#else #define log_debug(format, ...) printf(format, ## __VA_ARGS__) +#endif #else #define log_debug(...) #endif #ifdef ENABLE_LOG_INFO +#ifdef HAVE_HCI_DUMP +#define log_info(format, ...) hci_dump_log(format, ## __VA_ARGS__) +#else #define log_info(format, ...) printf(format, ## __VA_ARGS__) +#endif #else #define log_info(...) #endif #ifdef ENABLE_LOG_ERROR +#ifdef HAVE_HCI_DUMP +#define log_error(format, ...) hci_dump_log(format, ## __VA_ARGS__) +#else #define log_error(format, ...) printf(format, ## __VA_ARGS__) +#endif #else #define log_error(...) #endif