diff --git a/doc/manual/docs/how_to.md b/doc/manual/docs/how_to.md index 4cf46f211..2439ddeaa 100644 --- a/doc/manual/docs/how_to.md +++ b/doc/manual/docs/how_to.md @@ -72,7 +72,6 @@ ENABLE_EHCILL | Enable eHCILL low power mode on TI CC256x/WL18xx ENABLE_LOG_DEBUG | Enable log_debug messages ENABLE_LOG_ERROR | Enable log_error messages ENABLE_LOG_INFO | Enable log_info messages -ENABLE_LOG_INTO_HCI_DUMP | Log debug messages as part of packet log ENABLE_SCO_OVER_HCI | Enable SCO over HCI for chipsets (only CC256x/WL18xx and USB CSR controllers) ENABLE_LE_SECURE_CONNECTIONS | Enable LE Secure Connections using [mbed TLS library](https://tls.mbed.org) ENABLE_LE_DATA_CHANNELS | Enable LE Data Channels in credit-based flow control mode diff --git a/port/arduino/btstack_config.h b/port/arduino/btstack_config.h index 32507ef97..47ce386fd 100644 --- a/port/arduino/btstack_config.h +++ b/port/arduino/btstack_config.h @@ -10,7 +10,6 @@ // BTstack features that can be enabled #define ENABLE_BLE -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR #define ENABLE_LE_PERIPHERAL diff --git a/port/daemon/src/Makefile.in b/port/daemon/src/Makefile.in index b03f8f67b..94d209d09 100644 --- a/port/daemon/src/Makefile.in +++ b/port/daemon/src/Makefile.in @@ -29,6 +29,7 @@ usb_sources = @USB_SOURCES@ libBTstack_SOURCES = \ btstack.c \ socket_connection.c \ + hci_dump.c \ hci_cmd.c \ daemon_cmds.c \ btstack_linked_list.c \ @@ -79,7 +80,7 @@ libBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) # ranlib $@ BTdaemon: $(BTdaemon_SOURCES) - $(CC) $(CFLAGS) -DENABLE_LOG_INTO_HCI_DUMP -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS) clean: rm -rf libBTstack* BTdaemon *.o diff --git a/port/ez430-rf2560/btstack_config.h b/port/ez430-rf2560/btstack_config.h index ae2db174b..369a312c1 100644 --- a/port/ez430-rf2560/btstack_config.h +++ b/port/ez430-rf2560/btstack_config.h @@ -13,7 +13,6 @@ #define ENABLE_CLASSIC #define ENABLE_LE_PERIPHERAL // #define ENABLE_LE_CENTRAL -#define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO // #define ENABLE_EHCILL diff --git a/port/ios/btstack_config.h b/port/ios/btstack_config.h index f59011dfe..ba96708dc 100644 --- a/port/ios/btstack_config.h +++ b/port/ios/btstack_config.h @@ -15,7 +15,6 @@ #define ENABLE_CLASSIC #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP // BTstack configuration. buffers, sizes, ... diff --git a/port/libusb/btstack_config.h b/port/libusb/btstack_config.h index 926acf6cf..a2f38b515 100644 --- a/port/libusb/btstack_config.h +++ b/port/libusb/btstack_config.h @@ -19,7 +19,6 @@ #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP diff --git a/port/libusb2/btstack_config.h b/port/libusb2/btstack_config.h new file mode 100644 index 000000000..a2f38b515 --- /dev/null +++ b/port/libusb2/btstack_config.h @@ -0,0 +1,29 @@ +// +// btstack_config.h for libusb port +// + +#ifndef __BTSTACK_CONFIG +#define __BTSTACK_CONFIG + +// Port related features +#define HAVE_MALLOC +#define HAVE_POSIX_FILE_IO +#define HAVE_POSIX_STDIN +#define HAVE_POSIX_TIME + +// BTstack features that can be enabled +#define ENABLE_BLE +#define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL +#define ENABLE_LE_SECURE_CONNECTIONS +#define ENABLE_LOG_ERROR +#define ENABLE_LOG_INFO +#define ENABLE_SCO_OVER_HCI +#define ENABLE_SDP_DES_DUMP + +// BTstack configuration. buffers, sizes, ... +#define HCI_ACL_PAYLOAD_SIZE (1691 + 4) +#define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof BNEP header, avoid memcpy + +#endif diff --git a/port/msp-exp430f5438-cc2564b/btstack_config.h b/port/msp-exp430f5438-cc2564b/btstack_config.h index 7165bcd88..14f171290 100644 --- a/port/msp-exp430f5438-cc2564b/btstack_config.h +++ b/port/msp-exp430f5438-cc2564b/btstack_config.h @@ -13,7 +13,6 @@ #define ENABLE_CLASSIC #define ENABLE_LE_PERIPHERAL // #define ENABLE_LE_CENTRAL -// #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO // #define ENABLE_EHCILL diff --git a/port/msp430f5229lp-cc2564b/btstack_config.h b/port/msp430f5229lp-cc2564b/btstack_config.h index 5579f8187..3bb3ed302 100644 --- a/port/msp430f5229lp-cc2564b/btstack_config.h +++ b/port/msp430f5229lp-cc2564b/btstack_config.h @@ -13,7 +13,6 @@ #define ENABLE_CLASSIC #define ENABLE_LE_PERIPHERAL // #define ENABLE_LE_CENTRAL -#define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO // #define ENABLE_EHCILL diff --git a/port/mtk/btstack_config.h b/port/mtk/btstack_config.h index ffc5510fe..485fbcaff 100644 --- a/port/mtk/btstack_config.h +++ b/port/mtk/btstack_config.h @@ -17,7 +17,6 @@ #define ENABLE_LE_CENTRAL #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP // BTstack configuration. buffers, sizes, ... diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index e8531d822..4d94625d7 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -19,7 +19,6 @@ #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP // #define ENABLE_EHCILL diff --git a/port/posix-h5/btstack_config.h b/port/posix-h5/btstack_config.h index 6542908c7..6534ee604 100644 --- a/port/posix-h5/btstack_config.h +++ b/port/posix-h5/btstack_config.h @@ -19,7 +19,6 @@ #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP diff --git a/port/posix-h8/btstack_config.h b/port/posix-h8/btstack_config.h new file mode 100644 index 000000000..626ed503a --- /dev/null +++ b/port/posix-h8/btstack_config.h @@ -0,0 +1,29 @@ +// +// btstack_config.h for generic POSIX H4 port +// + +#ifndef __BTSTACK_CONFIG +#define __BTSTACK_CONFIG + +// Port related features +#define HAVE_MALLOC +#define HAVE_POSIX_FILE_IO +#define HAVE_POSIX_STDIN +#define HAVE_POSIX_TIME + +// BTstack features that can be enabled +#define ENABLE_BLE +#define ENABLE_CLASSIC +#define ENABLE_LE_SECURE_CONNECTIONS +#define ENABLE_LOG_ERROR +#define ENABLE_LOG_INFO +#define ENABLE_SCO_OVER_HCI +#define ENABLE_SDP_DES_DUMP +// #define ENABLE_EHCILL + +// BTstack configuration. buffers, sizes, ... +#define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy +#define HCI_ACL_PAYLOAD_SIZE (1691 + 4) + +#endif + diff --git a/port/windows-h4/btstack_config.h b/port/windows-h4/btstack_config.h index 926acf6cf..a2f38b515 100644 --- a/port/windows-h4/btstack_config.h +++ b/port/windows-h4/btstack_config.h @@ -19,7 +19,6 @@ #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP diff --git a/port/windows-winusb/btstack_config.h b/port/windows-winusb/btstack_config.h index 3b0a52f3c..1f58f58de 100644 --- a/port/windows-winusb/btstack_config.h +++ b/port/windows-winusb/btstack_config.h @@ -19,7 +19,6 @@ #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SCO_OVER_HCI #define ENABLE_SDP_DES_DUMP diff --git a/src/btstack_debug.h b/src/btstack_debug.h index 4e482459a..4bd1cf9b1 100644 --- a/src/btstack_debug.h +++ b/src/btstack_debug.h @@ -75,32 +75,20 @@ static inline void __log_unused(const char *format, ...) { #endif #ifdef ENABLE_LOG_DEBUG -#ifdef ENABLE_LOG_INTO_HCI_DUMP #define log_debug(format, ...) HCI_DUMP_LOG(LOG_LEVEL_DEBUG, format, ## __VA_ARGS__) #else -#define log_debug(format, ...) BTSTACK_PRINTF(format "\n", ## __VA_ARGS__) -#endif -#else #define log_debug(...) __log_unused(__VA_ARGS__) #endif #ifdef ENABLE_LOG_INFO -#ifdef ENABLE_LOG_INTO_HCI_DUMP #define log_info(format, ...) HCI_DUMP_LOG(LOG_LEVEL_INFO, format, ## __VA_ARGS__) #else -#define log_info(format, ...) BTSTACK_PRINTF(format "\n", ## __VA_ARGS__) -#endif -#else #define log_info(...) __log_unused(__VA_ARGS__) #endif #ifdef ENABLE_LOG_ERROR -#ifdef ENABLE_LOG_INTO_HCI_DUMP #define log_error(format, ...) HCI_DUMP_LOG(LOG_LEVEL_ERROR, format, ## __VA_ARGS__) #else -#define log_error(format, ...) BTSTACK_PRINTF(format "\n", ## __VA_ARGS__) -#endif -#else #define log_error(...) __log_unused(__VA_ARGS__) #endif diff --git a/test/btstack_config.h b/test/btstack_config.h index cf937c089..7d4ad80ba 100644 --- a/test/btstack_config.h +++ b/test/btstack_config.h @@ -17,7 +17,6 @@ #define ENABLE_LOG_DEBUG #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #define ENABLE_SDP_EXTRA_QUERIES // #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/test/btstack_link_key_db/btstack_config.h b/test/btstack_link_key_db/btstack_config.h index 64b271fd7..756caa1ec 100644 --- a/test/btstack_link_key_db/btstack_config.h +++ b/test/btstack_link_key_db/btstack_config.h @@ -14,7 +14,6 @@ #define ENABLE_LOG_DEBUG #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO -#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #define ENABLE_SDP_EXTRA_QUERIES