From 2539bee62fdca025ea003597dac8d060b8821540 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 Jan 2016 21:27:06 +0100 Subject: [PATCH] HAVE_HCI_DUMP -> ENABLE_LOG_INTO_HCI_DUMP --- port/arduino/btstack_config.h | 7 ++- port/daemon/src/Makefile.in | 2 +- port/ez430-rf2560/btstack_config.h | 30 +++++++++++- port/ios/btstack_config.h | 2 +- port/libusb/btstack_config.h | 2 +- port/msp-exp430f5438-cc2564b/btstack_config.h | 2 +- port/msp430f5229lp-cc2564b/btstack_config.h | 2 +- port/mtk/btstack_config.h | 2 +- port/posix-cc2564b/btstack_config.h | 2 +- port/posix-csr/btstack_config.h | 2 +- port/posix-h4/btstack_config.h | 2 +- port/posix-stlc2500d/btstack_config.h | 2 +- port/posix-tc35661/btstack_config.h | 2 +- port/posix-wl183x/btstack_config.h | 2 +- src/btstack_debug.h | 6 +-- test/btstack_config.h | 46 ++++++------------- 16 files changed, 64 insertions(+), 49 deletions(-) diff --git a/port/arduino/btstack_config.h b/port/arduino/btstack_config.h index 547d13b3e..2a914ece9 100644 --- a/port/arduino/btstack_config.h +++ b/port/arduino/btstack_config.h @@ -1,14 +1,19 @@ +// +// btstack_config.h for Arduino port +// + #ifndef __BTSTACK_CONFIG #define __BTSTACK_CONFIG #define EMBEDDED +// Port related features #define HAVE_BZERO #define HAVE_TIME_MS #define ENABLE_BLE -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR diff --git a/port/daemon/src/Makefile.in b/port/daemon/src/Makefile.in index 809ea4249..304fa371d 100644 --- a/port/daemon/src/Makefile.in +++ b/port/daemon/src/Makefile.in @@ -78,7 +78,7 @@ libBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) # ranlib $@ BTdaemon: $(BTdaemon_SOURCES) - $(CC) $(CFLAGS) -DHAVE_HCI_DUMP -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS) + $(CC) $(CFLAGS) -DENABLE_LOG_INTO_HCI_DUMP -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 2ca0cc49f..9c4ba4afb 100644 --- a/port/ez430-rf2560/btstack_config.h +++ b/port/ez430-rf2560/btstack_config.h @@ -12,7 +12,7 @@ #define HAVE_EHCILL -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO @@ -41,3 +41,31 @@ #endif + +// +// btstack_config.h for Arduino port +// + +#ifndef __BTSTACK_CONFIG +#define __BTSTACK_CONFIG + +// Port related features +#define HAVE_INIT_SCRIPT +#define HAVE_BZERO +#define HAVE_TIME +#define HAVE_MALLOC + +// BTstack features that can be enabled +#define ENABLE_BLE +#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 + +// BTstack configuration. buffers, sizes, ... +#define HCI_ACL_PAYLOAD_SIZE 52 +#define HCI_INCOMING_PRE_BUFFER_SIZE 4 + +#endif diff --git a/port/ios/btstack_config.h b/port/ios/btstack_config.h index 8f6ec3c76..54877604b 100644 --- a/port/ios/btstack_config.h +++ b/port/ios/btstack_config.h @@ -17,7 +17,7 @@ #define HAVE_TIME #define HAVE_MALLOC #define HAVE_BZERO -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR #define HCI_ACL_PAYLOAD_SIZE 1021 diff --git a/port/libusb/btstack_config.h b/port/libusb/btstack_config.h index 28df7e29a..d87579bcb 100644 --- a/port/libusb/btstack_config.h +++ b/port/libusb/btstack_config.h @@ -7,7 +7,7 @@ #define ENABLE_LOG_INFO #define ENABLE_BLE #define HAVE_BZERO -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define HAVE_MALLOC #define ENABLE_RFCOMM #define ENABLE_SDP diff --git a/port/msp-exp430f5438-cc2564b/btstack_config.h b/port/msp-exp430f5438-cc2564b/btstack_config.h index 2ca0cc49f..417b0e6ea 100644 --- a/port/msp-exp430f5438-cc2564b/btstack_config.h +++ b/port/msp-exp430f5438-cc2564b/btstack_config.h @@ -12,7 +12,7 @@ #define HAVE_EHCILL -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/port/msp430f5229lp-cc2564b/btstack_config.h b/port/msp430f5229lp-cc2564b/btstack_config.h index 2ca0cc49f..417b0e6ea 100644 --- a/port/msp430f5229lp-cc2564b/btstack_config.h +++ b/port/msp430f5229lp-cc2564b/btstack_config.h @@ -12,7 +12,7 @@ #define HAVE_EHCILL -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/port/mtk/btstack_config.h b/port/mtk/btstack_config.h index 0ad08c362..0af5cc8f8 100644 --- a/port/mtk/btstack_config.h +++ b/port/mtk/btstack_config.h @@ -14,7 +14,7 @@ #define HAVE_TIME #define HAVE_MALLOC #define HAVE_BZERO -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR #define HCI_ACL_PAYLOAD_SIZE 1021 diff --git a/port/posix-cc2564b/btstack_config.h b/port/posix-cc2564b/btstack_config.h index a2075010d..466fa6960 100644 --- a/port/posix-cc2564b/btstack_config.h +++ b/port/posix-cc2564b/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_LOG_ERROR #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #endif diff --git a/port/posix-csr/btstack_config.h b/port/posix-csr/btstack_config.h index 448533881..48b3fae66 100644 --- a/port/posix-csr/btstack_config.h +++ b/port/posix-csr/btstack_config.h @@ -7,7 +7,7 @@ #define ENABLE_LOG_INFO #define ENABLE_BLE #define HAVE_BZERO -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define HAVE_MALLOC #define ENABLE_RFCOMM #define ENABLE_SDP diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index a2075010d..466fa6960 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_LOG_ERROR #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #endif diff --git a/port/posix-stlc2500d/btstack_config.h b/port/posix-stlc2500d/btstack_config.h index a2075010d..466fa6960 100644 --- a/port/posix-stlc2500d/btstack_config.h +++ b/port/posix-stlc2500d/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_LOG_ERROR #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #endif diff --git a/port/posix-tc35661/btstack_config.h b/port/posix-tc35661/btstack_config.h index 518ea9f48..867a32814 100644 --- a/port/posix-tc35661/btstack_config.h +++ b/port/posix-tc35661/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_LOG_ERROR #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #endif diff --git a/port/posix-wl183x/btstack_config.h b/port/posix-wl183x/btstack_config.h index 41a59ab7a..a352e854d 100644 --- a/port/posix-wl183x/btstack_config.h +++ b/port/posix-wl183x/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_LOG_ERROR #define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define HAVE_HCI_DUMP +#define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_SDP_DES_DUMP #define HAVE_SCO diff --git a/src/btstack_debug.h b/src/btstack_debug.h index 776d86e7f..7e69eb4cb 100644 --- a/src/btstack_debug.h +++ b/src/btstack_debug.h @@ -70,7 +70,7 @@ static inline void __log_unused(const char *format, ...) { #endif #ifdef ENABLE_LOG_DEBUG -#ifdef HAVE_HCI_DUMP +#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__) @@ -80,7 +80,7 @@ static inline void __log_unused(const char *format, ...) { #endif #ifdef ENABLE_LOG_INFO -#ifdef HAVE_HCI_DUMP +#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__) @@ -90,7 +90,7 @@ static inline void __log_unused(const char *format, ...) { #endif #ifdef ENABLE_LOG_ERROR -#ifdef HAVE_HCI_DUMP +#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__) diff --git a/test/btstack_config.h b/test/btstack_config.h index 82441e0c2..54ebe7447 100644 --- a/test/btstack_config.h +++ b/test/btstack_config.h @@ -1,45 +1,27 @@ -// #define EMBEDDED -// #define HAVE_TICK +// +// btstack_config.h for Arduino port +// +#ifndef __BTSTACK_CONFIG +#define __BTSTACK_CONFIG + +// Port related features #define HAVE_INIT_SCRIPT #define HAVE_BZERO #define HAVE_TIME -#define ENABLE_SDP_DES_DUMP +#define HAVE_MALLOC + +// BTstack features that can be enabled #define ENABLE_BLE - #define ENABLE_LOG_DEBUG -#define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR -#define HAVE_HCI_DUMP - +#define ENABLE_LOG_INFO +#define ENABLE_LOG_INTO_HCI_DUMP +#define ENABLE_SDP_DES_DUMP #define ENABLE_SDP_EXTRA_QUERIES +// BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 52 #define HCI_INCOMING_PRE_BUFFER_SIZE 4 -#define MAX_SPP_CONNECTIONS 1 - -#define MAX_NO_HCI_CONNECTIONS MAX_SPP_CONNECTIONS -#define MAX_NO_L2CAP_SERVICES 2 -#define MAX_NO_L2CAP_CHANNELS (1+MAX_SPP_CONNECTIONS) -#define MAX_NO_RFCOMM_MULTIPLEXERS MAX_SPP_CONNECTIONS -#define MAX_NO_RFCOMM_SERVICES 1 -#define MAX_NO_RFCOMM_CHANNELS MAX_SPP_CONNECTIONS -#define MAX_NO_BNEP_SERVICES 1 -#define MAX_NO_BNEP_CHANNELS MAX_SPP_CONNECTIONS -#define MAX_NO_DB_MEM_DEVICE_LINK_KEYS 2 -#define MAX_NO_DB_MEM_DEVICE_NAMES 2 -#define MAX_NO_DB_MEM_SERVICES 1 -#define MAX_NO_WHITELIST_ENTRIES 1 -#define HAVE_MALLOC - -#if 0 -// DeLock 4.0 Dongle (Broadcom BCM20702A0) -#define USB_VENDOR_ID 0x0a5c -#define USB_PRODUCT_ID 0x21e8 - -#else -// Generic CSR 4.0 Dongle -// #define USB_VENDOR_ID 0x0a12 -// #define USB_PRODUCT_ID 0x0001 #endif