summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bta/Android.mk4
-rw-r--r--btif/src/btif_dm.c5
-rw-r--r--conf/Android.mk24
-rw-r--r--conf/bt_stack.conf26
-rw-r--r--conf/moto/wingray/Android.mk14
-rw-r--r--conf/moto/wingray/bt_vendor.conf48
-rw-r--r--conf/samsung/crespo/Android.mk14
-rw-r--r--conf/samsung/crespo/bt_vendor.conf48
-rw-r--r--conf/samsung/maguro/Android.mk14
-rw-r--r--conf/samsung/maguro/bt_vendor.conf48
-rw-r--r--gki/Android.mk4
-rw-r--r--include/bdroid_crespo.txt199
-rw-r--r--include/bdroid_maguro.txt197
-rw-r--r--include/bdroid_toro.txt197
-rw-r--r--include/bdroid_wingray.txt197
-rw-r--r--include/bt_trace.h12
-rw-r--r--include/buildcfg.h6
-rw-r--r--include/buildcfg.mk13
-rw-r--r--include/buildcfg_crespo.h237
-rw-r--r--include/buildcfg_maguro.h235
-rwxr-xr-xmain/Android.mk7
-rw-r--r--main/bte_conf.c221
-rw-r--r--main/bte_logmsg.c167
-rw-r--r--main/bte_main.c8
-rw-r--r--stack/Android.mk4
-rw-r--r--vendor/libvendor/Android.mk16
-rw-r--r--vendor/libvendor/include/bt_vendor_brcm.h24
-rw-r--r--vendor/libvendor/include/userial.h12
-rw-r--r--vendor/libvendor/include/vnd_buildcfg.h14
-rw-r--r--vendor/libvendor/include/vnd_crespo.txt11
-rw-r--r--vendor/libvendor/include/vnd_maguro.txt11
-rw-r--r--vendor/libvendor/include/vnd_toro.txt11
-rw-r--r--vendor/libvendor/include/vnd_wingray.txt12
-rw-r--r--vendor/libvendor/src/bt_vendor_brcm.c15
-rw-r--r--vendor/libvendor/src/btsnoop.c145
-rw-r--r--vendor/libvendor/src/conf.c199
-rw-r--r--vendor/libvendor/src/hardware.c39
-rw-r--r--vendor/libvendor/src/hci_h4.c35
-rw-r--r--vendor/libvendor/src/upio.c6
-rw-r--r--vendor/libvendor/src/userial.c27
40 files changed, 1818 insertions, 708 deletions
diff --git a/bta/Android.mk b/bta/Android.mk
index 9471187..0076c3f 100644
--- a/bta/Android.mk
+++ b/bta/Android.mk
@@ -2,6 +2,8 @@ ifneq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)
+include $(LOCAL_PATH)/../include/buildcfg.mk
+
include $(CLEAR_VARS)
ifeq ($(BOARD_HAVE_BLUETOOTH_BCM),true)
@@ -121,7 +123,7 @@ LOCAL_SRC_FILES:= \
./sys/utl.c
LOCAL_MODULE := libbt-brcm_bta
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libc
LOCAL_C_INCLUDES+= . \
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 6210a5f..40dcdc4 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -896,8 +896,7 @@ static void btif_dm_upstreams_evt(UINT16 event, char* p_param)
*/
if (status != BT_STATUS_SUCCESS)
{
- /* TODO: BTM_DEF_LOCAL_NAME should be configurable */
- BTA_DmSetDeviceName(BTM_DEF_LOCAL_NAME);
+ BTA_DmSetDeviceName((char *)BTM_DEF_LOCAL_NAME);
/* Hmmm...Should we store this too??? */
}
else
@@ -1329,7 +1328,7 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t *prop)
case BT_PROPERTY_BDNAME:
{
bt_bdname_t *bd_name = (bt_bdname_t*)prop->val;
- strcpy((char *)bd_name->name, BTM_DEF_LOCAL_NAME);
+ strcpy((char *)bd_name->name, (char *)BTM_DEF_LOCAL_NAME);
prop->len = strlen((char *)bd_name->name)+1;
}
break;
diff --git a/conf/Android.mk b/conf/Android.mk
new file mode 100644
index 0000000..1d613f6
--- /dev/null
+++ b/conf/Android.mk
@@ -0,0 +1,24 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bt_stack.conf
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth
+
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+
+include $(BUILD_PREBUILT)
+
+ifeq ($(TARGET_PRODUCT), full_maguro)
+ include $(LOCAL_PATH)/samsung/maguro/Android.mk
+endif
+ifeq ($(TARGET_PRODUCT), full_crespo)
+ include $(LOCAL_PATH)/samsung/crespo/Android.mk
+endif
+ifeq ($(TARGET_PRODUCT), full_wingray)
+ include $(LOCAL_PATH)/moto/wingray/Android.mk
+endif
diff --git a/conf/bt_stack.conf b/conf/bt_stack.conf
new file mode 100644
index 0000000..c64e538
--- /dev/null
+++ b/conf/bt_stack.conf
@@ -0,0 +1,26 @@
+# Enable trace level reconfiguration function
+# Must be present before any TRC_ trace level settings
+TraceConf=true
+
+# Trace level configuration
+# BT_TRACE_LEVEL_NONE 0 ( No trace messages to be generated )
+# BT_TRACE_LEVEL_ERROR 1 ( Error condition trace messages )
+# BT_TRACE_LEVEL_WARNING 2 ( Warning condition trace messages )
+# BT_TRACE_LEVEL_API 3 ( API traces )
+# BT_TRACE_LEVEL_EVENT 4 ( Debug messages for events )
+# BT_TRACE_LEVEL_DEBUG 5 ( Full debug messages )
+TRC_BTM=5
+TRC_HCI=5
+TRC_L2CAP=5
+TRC_RFCOMM=5
+TRC_OBEX=5
+TRC_AVCT=5
+TRC_AVDT=5
+TRC_AVRC=5
+TRC_AVDT_SCB=5
+TRC_AVDT_CCB=5
+TRC_A2D=5
+TRC_SDP=5
+TRC_GATT=5
+TRC_SMP=5
+TRC_BTAPP=5
diff --git a/conf/moto/wingray/Android.mk b/conf/moto/wingray/Android.mk
new file mode 100644
index 0000000..974e213
--- /dev/null
+++ b/conf/moto/wingray/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bt_vendor.conf
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+
+include $(BUILD_PREBUILT)
+
diff --git a/conf/moto/wingray/bt_vendor.conf b/conf/moto/wingray/bt_vendor.conf
new file mode 100644
index 0000000..a7ec8c7
--- /dev/null
+++ b/conf/moto/wingray/bt_vendor.conf
@@ -0,0 +1,48 @@
+# UART device port where Bluetooth controller is attached
+UartPort = /dev/ttyHS2
+
+# Firmware patch file location
+FwPatchFilePath = /etc/firmware/
+
+# Enable/Disable debug mode of libbt-vendor.so library
+# The main key turns on/off debug modes of the whole library
+# valid value : true, false
+EnableDebug = true
+
+# The sub-key to enable/disable BtSnoop logging function
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopLogOutput = true
+
+# BtSnoop log output file
+BtSnoopFileName = /data/misc/bluedroid/btsnoop_hci.log
+
+# The sub-key to enable/disable trace output of main vendor lib module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+VndDebug = true
+
+# The sub-key to enable/disable trace output of hardware.c module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HwDebug = true
+
+# The sub-key to enable/disable trace output of userial module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UserialDebug = false
+
+# The sub-key to enable/disable trace output of Transport (e.g. H4) module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HciDebug = false
+
+# The sub-key to enable/disable trace output of upio module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UpioDebug = false
+
+# The sub-key to enable/disable debugging in BtSnoop module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopDebug = false
diff --git a/conf/samsung/crespo/Android.mk b/conf/samsung/crespo/Android.mk
new file mode 100644
index 0000000..974e213
--- /dev/null
+++ b/conf/samsung/crespo/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bt_vendor.conf
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+
+include $(BUILD_PREBUILT)
+
diff --git a/conf/samsung/crespo/bt_vendor.conf b/conf/samsung/crespo/bt_vendor.conf
new file mode 100644
index 0000000..5bfc8a5
--- /dev/null
+++ b/conf/samsung/crespo/bt_vendor.conf
@@ -0,0 +1,48 @@
+# UART device port where Bluetooth controller is attached
+UartPort = /dev/s3c2410_serial0
+
+# Firmware patch file location
+FwPatchFilePath = /vendor/firmware/
+
+# Enable/Disable debug mode of libbt-vendor.so library
+# The main key turns on/off debug modes of the whole library
+# valid value : true, false
+EnableDebug = true
+
+# The sub-key to enable/disable BtSnoop logging function
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopLogOutput = true
+
+# BtSnoop log output file
+BtSnoopFileName = /data/misc/bluedroid/btsnoop_hci.log
+
+# The sub-key to enable/disable trace output of main vendor lib module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+VndDebug = false
+
+# The sub-key to enable/disable trace output of hardware.c module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HwDebug = false
+
+# The sub-key to enable/disable trace output of userial module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UserialDebug = false
+
+# The sub-key to enable/disable trace output of Transport (e.g. H4) module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HciDebug = false
+
+# The sub-key to enable/disable trace output of upio module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UpioDebug = false
+
+# The sub-key to enable/disable debugging in BtSnoop module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopDebug = false
diff --git a/conf/samsung/maguro/Android.mk b/conf/samsung/maguro/Android.mk
new file mode 100644
index 0000000..974e213
--- /dev/null
+++ b/conf/samsung/maguro/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bt_vendor.conf
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+
+include $(BUILD_PREBUILT)
+
diff --git a/conf/samsung/maguro/bt_vendor.conf b/conf/samsung/maguro/bt_vendor.conf
new file mode 100644
index 0000000..fe75246
--- /dev/null
+++ b/conf/samsung/maguro/bt_vendor.conf
@@ -0,0 +1,48 @@
+# UART device port where Bluetooth controller is attached
+UartPort = /dev/ttyO1
+
+# Firmware patch file location
+FwPatchFilePath = /vendor/firmware/
+
+# Enable/Disable debug mode of libbt-vendor.so library
+# The main key turns on/off debug modes of the whole library
+# valid value : true, false
+EnableDebug = true
+
+# The sub-key to enable/disable BtSnoop logging function
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopLogOutput = true
+
+# BtSnoop log output file
+BtSnoopFileName = /data/misc/bluedroid/btsnoop_hci.log
+
+# The sub-key to enable/disable trace output of main vendor lib module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+VndDebug = false
+
+# The sub-key to enable/disable trace output of hardware.c module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HwDebug = false
+
+# The sub-key to enable/disable trace output of userial module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UserialDebug = false
+
+# The sub-key to enable/disable trace output of Transport (e.g. H4) module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+HciDebug = false
+
+# The sub-key to enable/disable trace output of upio module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+UpioDebug = false
+
+# The sub-key to enable/disable debugging in BtSnoop module
+# The key is masked off if EnableDebug is false
+# valid value : true, false
+BtSnoopDebug = false
diff --git a/gki/Android.mk b/gki/Android.mk
index 2317fc0..13681ea 100644
--- a/gki/Android.mk
+++ b/gki/Android.mk
@@ -2,6 +2,8 @@ ifneq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)
+include $(LOCAL_PATH)/../include/buildcfg.mk
+
include $(CLEAR_VARS)
LOCAL_C_INCLUDES:= $(LOCAL_PATH)/common \
@@ -25,7 +27,7 @@ LOCAL_SRC_FILES:= \
./common/gki_buffer.c
LOCAL_MODULE := libbt-brcm_gki
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libc
include $(BUILD_STATIC_LIBRARY)
diff --git a/include/bdroid_crespo.txt b/include/bdroid_crespo.txt
new file mode 100644
index 0000000..acb411b
--- /dev/null
+++ b/include/bdroid_crespo.txt
@@ -0,0 +1,199 @@
+AVCT_INCLUDED = TRUE
+AVRC_INCLUDED = TRUE
+AVRC_METADATA_INCLUDED = FALSE
+AVRC_ADV_CTRL_INCLUDED = FALSE
+AVDT_INCLUDED = TRUE
+UNV_INCLUDED = FALSE
+A2D_INCLUDED = TRUE
+A2D_SBC_INCLUDED = TRUE
+A2D_M12_INCLUDED = FALSE
+A2D_M24_INCLUDED = FALSE
+VDP_INCLUDED = FALSE
+VDP_H263_INCLUDED = FALSE
+VDP_MPEG_INCLUDED = FALSE
+VDP_VEND_INCLUDED = FALSE
+BIP_INCLUDED = FALSE
+BIP_INITR_INCLUDED = FALSE
+BIP_RSPDR_INCLUDED = FALSE
+BIP_PUSH_INCLUDED = FALSE
+BIP_PULL_INCLUDED = FALSE
+BIP_PRINTING_INCLUDED = FALSE
+BIP_ARCHIVE_INCLUDED = FALSE
+BIP_CAMERA_INCLUDED = FALSE
+BIP_DISPLAY_INCLUDED = FALSE
+BPP_INCLUDED = FALSE
+BPP_SND_INCLUDED = FALSE
+DUN_INCLUDED = FALSE
+GAP_INCLUDED = FALSE
+GOEP_INCLUDED = FALSE
+GOEP_FS_INCLUDED = FALSE
+GATT_PTS = FALSE
+BTM_SEC_MAX_SERVICE_RECORDS = 32
+L2CAP_INCLUDED = TRUE
+L2CAP_LINK_INACTIVITY_TOUT = 4
+L2CAP_FCR_INCLUDED = TRUE
+L2CAP_EXTFEA_SUPPORTED_MASK = (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
+OBX_INCLUDED = TRUE
+OBX_SERVER_INCLUDED = TRUE
+OBX_CLIENT_INCLUDED = TRUE
+OBX_MD5_INCLUDED = FALSE
+OBX_MD5_TEST_INCLUDED = FALSE
+OBX_14_INCLUDED = FALSE
+BTUI_OPS_FORMATS = (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
+BTA_OPC_SENDING_ABORT = TRUE
+RFCOMM_INCLUDED = TRUE
+MAX_RFC_PORTS = 30
+MAX_BD_CONNECTIONS = 7
+BTA_RFC_MTU_SIZE = (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
+PORT_TX_BUF_HIGH_WM = 10
+PORT_RX_BUF_HIGH_WM = 10
+PORT_RX_BUF_LOW_WM = 4
+PORT_RX_BUF_CRITICAL_WM = 15
+PORT_TX_BUF_CRITICAL_WM = 15
+PORT_RX_LOW_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
+PORT_RX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
+PORT_RX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
+PORT_TX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
+PORT_TX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
+BTA_DUN_MTU = BTA_RFC_MTU_SIZE
+BTA_SPP_MTU = BTA_RFC_MTU_SIZE
+BTA_FAX_MTU = BTA_RFC_MTU_SIZE
+SDP_DI_INCLUDED = TRUE
+SDP_RAW_DATA_INCLUDED = TRUE
+SDP_RAW_PDU_INCLUDED = TRUE
+SDP_POOL_ID = 3
+SDP_MAX_REC_ATTR = 25
+SDP_MAX_ATTR_LEN = 400
+SDP_MAX_PAD_LEN = 600
+BNEP_INCLUDED = FALSE
+PAN_INCLUDED = FALSE
+SAP_SERVER_INCLUDED = FALSE
+HID_DEV_INCLUDED = FALSE
+HID_HOST_INCLUDED = TRUE
+BLE_INCLUDED = FALSE
+BTM_BLE_CONFORMANCE_TESTING = FALSE
+ATT_INCLUDED = FALSE
+ATT_DEBUG = FALSE
+GATTS_APPU_USE_GATT_TRACE = FALSE
+GATT_CLIENT_ENABLED = FALSE
+GATT_SERVER_ENABLED = FALSE
+SMP_INCLUDED = FALSE
+SMP_HOST_ENCRYPT_INCLUDED = FALSE
+SER_INCLUDED = FALSE
+RPC_INCLUDED = FALSE
+MMI_INCLUDED = FALSE
+SAP_INCLUDED = FALSE
+SBC_NO_PCM_CPY_OPTION = FALSE
+SBC_IPAQ_OPT = FALSE
+SBC_IS_64_MULT_IN_QUANTIZER = FALSE
+BTE_HCIUTILS_HOOK_INCLUDED = FALSE
+BTA_INCLUDED = TRUE
+BTA_AG_INCLUDED = TRUE
+BTA_CT_INCLUDED = FALSE
+BTA_CG_INCLUDED = FALSE
+BTA_DG_INCLUDED = FALSE
+BTA_FT_INCLUDED = FALSE
+BTA_OP_INCLUDED = FALSE
+BTA_PR_INCLUDED = FALSE
+BTA_SS_INCLUDED = FALSE
+BTA_DM_INCLUDED = TRUE
+BTA_DI_INCLUDED = FALSE
+BTA_BI_INCLUDED = FALSE
+BTA_SC_INCLUDED = FALSE
+BTA_PAN_INCLUDED = FALSE
+BTA_FS_INCLUDED = TRUE
+BTA_AC_INCLUDED = FALSE
+BTA_HD_INCLUDED = FALSE
+BTA_HH_INCLUDED = TRUE
+HH_USE_BTHID = TRUE
+BTA_AR_INCLUDED = TRUE
+BTA_AV_INCLUDED = TRUE
+BTA_AV_VDP_INCLUDED = FALSE
+BTA_AVK_INCLUDED = FALSE
+BTA_PBS_INCLUDED = FALSE
+BTA_PBC_INCLUDED = FALSE
+BTA_FM_INCLUDED = FALSE
+BTA_FM_DEBUG = FALSE
+BTA_FMTX_INCLUDED = FALSE
+BTA_FMTX_DEBUG = FALSE
+BTA_FMTX_FMRX_SWITCH_WORKAROUND = FALSE
+BTA_FMTX_US_FCC_RULES = FALSE
+BTA_HS_INCLUDED = FALSE
+BTA_MSE_INCLUDED = FALSE
+BTA_MCE_INCLUDED = FALSE
+BTA_PLAYBACK_INCLUDED = FALSE
+BTA_SSR_INCLUDED = FALSE
+BTA_JV_INCLUDED = FALSE
+BTA_EIR_CANNED_UUID_LIST = FALSE
+BTA_GATT_INCLUDED = FALSE
+RSI_INCLUDED = TRUE
+RPC_TRACE_ONLY = FALSE
+ANDROID_APP_INCLUDED = TRUE
+ANDROID_USE_LOGCAT = TRUE
+LINUX_GKI_INCLUDED = TRUE
+TICKS_PER_SEC = 100
+QUICK_TIMER_TICKS_PER_SEC = 10
+BTA_SYS_TIMER_PERIOD = 100
+GKI_BUF1_SIZE = 288
+GKI_BUF3_MAX = 200
+GKI_BUF3_SIZE = (4096+16)
+GKI_BUF4_SIZE = (8080+26)
+GKI_SHUTDOWN_EVT = APPL_EVT_7
+GKI_PTHREAD_JOINABLE = TRUE
+LINUX_DRV_INCLUDED = TRUE
+LINUX_OS = TRUE
+BTU_TASK = 0
+BTIF_TASK = 1
+A2DP_MEDIA_TASK = 2
+GKI_MAX_TASKS = 3
+BTM_APP_DEV_INIT = bte_main_post_reset_init
+BTE_IDLE_TASK_INCLUDED = FALSE
+APPL_INCLUDED = TRUE
+BTU_BTA_INCLUDED = TRUE
+SBC_FOR_EMBEDDED_LINUX = TRUE
+BTA_DM_REMOTE_DEVICE_NAME_LENGTH = 248
+BTM_MAX_REM_BD_NAME_LEN = 248
+BTM_MAX_LOC_BD_NAME_LEN = 248
+BTM_USE_DEF_LOCAL_NAME = TRUE
+BTM_DEF_LOCAL_NAME = "Nexus S 2"
+BTM_INQ_DB_SIZE = 40
+BTM_SEC_MAX_DEVICE_RECORDS = 100
+BTM_SEC_FORCE_RNR_FOR_DBOND = FALSE
+BTM_AUTOMATIC_HCI_RESET = FALSE
+AVDT_VERSION = 0x0102
+BTA_AG_AT_MAX_LEN = 512
+BTA_AVRCP_FF_RW_SUPPORT = TRUE
+BTM_MAX_SCO_LINKS = 2
+BTA_AG_SCO_PKT_TYPES = (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
+BTAPP_AV_SECMASK = (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
+BTA_AV_MAX_A2DP_MTU = 668
+BTA_AV_RET_TOUT = 15
+PORCHE_PAIRING_CONFLICT = TRUE
+BTA_AV_CO_CP_SCMS_T = FALSE
+AVDT_CONNECT_CP_ONLY = FALSE
+BTL_CFG_USE_CONF_FILE = FALSE
+BTAPP_AHF_API_SUPPORT = TRUE
+HCILP_INCLUDED = TRUE
+HCISU_H4_INCLUDED = TRUE
+BT_TRACE_PROTOCOL = TRUE
+BT_USE_TRACES = TRUE
+BT_TRACE_BTIF = TRUE
+BTTRC_INCLUDED = FALSE
+BT_TRACE_VERBOSE = FALSE
+BTTRC_PARSER_INCLUDED = FALSE
+MAX_TRACE_RAM_SIZE = 10000
+OBX_INITIAL_TRACE_LEVEL = BT_TRACE_LEVEL_ERROR
+BTM_ALLOW_CONN_IF_NONDISCOVER = TRUE
+BTAPP_FM_USE_HW_POKE_VOLUME = FALSE
+BTAPP_FM_AUDIO_PATH = BTA_FM_AUDIO_DAC
+BTAPP_DM_SUPPORTED_SERVICES = (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK | BTA_NAP_SERVICE_MASK | BTA_PANU_SERVICE_MASK | BTA_HL_SERVICE_MASK)
+PBAP_ZERO_VCARD_IN_DB = FALSE
+BTA_DM_SDP_DB_SIZE = 4096
+MAX_L2CAP_CLIENTS = 15
+FTS_REJECT_INVALID_OBEX_SET_PATH_REQ = TRUE
+HID_HOST_MAX_CONN_RETRY = (3)
+BTM_DISC_DURING_RS = TRUE
+BTM_WBS_INCLUDED = FALSE
+HL_INCLUDED = FALSE
+NO_GKI_RUN_RETURN = TRUE
+AG_VOICE_SETTINGS = HCI_DEFAULT_VOICE_SETTINGS
diff --git a/include/bdroid_maguro.txt b/include/bdroid_maguro.txt
new file mode 100644
index 0000000..0f300e5
--- /dev/null
+++ b/include/bdroid_maguro.txt
@@ -0,0 +1,197 @@
+AVCT_INCLUDED = TRUE
+AVRC_INCLUDED = TRUE
+AVRC_METADATA_INCLUDED = FALSE
+AVRC_ADV_CTRL_INCLUDED = FALSE
+AVDT_INCLUDED = TRUE
+UNV_INCLUDED = FALSE
+A2D_INCLUDED = TRUE
+A2D_SBC_INCLUDED = TRUE
+A2D_M12_INCLUDED = FALSE
+A2D_M24_INCLUDED = FALSE
+VDP_INCLUDED = FALSE
+VDP_H263_INCLUDED = FALSE
+VDP_MPEG_INCLUDED = FALSE
+VDP_VEND_INCLUDED = FALSE
+BIP_INCLUDED = FALSE
+BIP_INITR_INCLUDED = FALSE
+BIP_RSPDR_INCLUDED = FALSE
+BIP_PUSH_INCLUDED = FALSE
+BIP_PULL_INCLUDED = FALSE
+BIP_PRINTING_INCLUDED = FALSE
+BIP_ARCHIVE_INCLUDED = FALSE
+BIP_CAMERA_INCLUDED = FALSE
+BIP_DISPLAY_INCLUDED = FALSE
+BPP_INCLUDED = FALSE
+BPP_SND_INCLUDED = FALSE
+DUN_INCLUDED = FALSE
+GAP_INCLUDED = FALSE
+GOEP_INCLUDED = FALSE
+GOEP_FS_INCLUDED = FALSE
+GATT_PTS = FALSE
+BTM_SEC_MAX_SERVICE_RECORDS = 32
+L2CAP_INCLUDED = TRUE
+L2CAP_LINK_INACTIVITY_TOUT = 4
+L2CAP_FCR_INCLUDED = TRUE
+L2CAP_EXTFEA_SUPPORTED_MASK = (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
+OBX_INCLUDED = TRUE
+OBX_SERVER_INCLUDED = TRUE
+OBX_CLIENT_INCLUDED = TRUE
+OBX_MD5_INCLUDED = FALSE
+OBX_MD5_TEST_INCLUDED = FALSE
+OBX_14_INCLUDED = FALSE
+BTUI_OPS_FORMATS = (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
+BTA_OPC_SENDING_ABORT = TRUE
+RFCOMM_INCLUDED = TRUE
+MAX_RFC_PORTS = 30
+MAX_BD_CONNECTIONS = 7
+BTA_RFC_MTU_SIZE = (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
+PORT_TX_BUF_HIGH_WM = 10
+PORT_RX_BUF_HIGH_WM = 10
+PORT_RX_BUF_LOW_WM = 4
+PORT_RX_BUF_CRITICAL_WM = 15
+PORT_TX_BUF_CRITICAL_WM = 15
+PORT_RX_LOW_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
+PORT_RX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
+PORT_RX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
+PORT_TX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
+PORT_TX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
+BTA_DUN_MTU = BTA_RFC_MTU_SIZE
+BTA_SPP_MTU = BTA_RFC_MTU_SIZE
+BTA_FAX_MTU = BTA_RFC_MTU_SIZE
+SDP_DI_INCLUDED = TRUE
+SDP_RAW_DATA_INCLUDED = TRUE
+SDP_RAW_PDU_INCLUDED = TRUE
+SDP_POOL_ID = 3
+SDP_MAX_REC_ATTR = 25
+SDP_MAX_ATTR_LEN = 400
+SDP_MAX_PAD_LEN = 600
+BNEP_INCLUDED = FALSE
+PAN_INCLUDED = FALSE
+SAP_SERVER_INCLUDED = FALSE
+HID_DEV_INCLUDED = FALSE
+HID_HOST_INCLUDED = TRUE
+BLE_INCLUDED = FALSE
+BTM_BLE_CONFORMANCE_TESTING = FALSE
+ATT_INCLUDED = FALSE
+ATT_DEBUG = FALSE
+GATTS_APPU_USE_GATT_TRACE = FALSE
+GATT_CLIENT_ENABLED = FALSE
+GATT_SERVER_ENABLED = FALSE
+SMP_INCLUDED = FALSE
+SMP_HOST_ENCRYPT_INCLUDED = FALSE
+SER_INCLUDED = FALSE
+RPC_INCLUDED = FALSE
+MMI_INCLUDED = FALSE
+SAP_INCLUDED = FALSE
+SBC_NO_PCM_CPY_OPTION = FALSE
+SBC_IPAQ_OPT = FALSE
+SBC_IS_64_MULT_IN_QUANTIZER = FALSE
+BTE_HCIUTILS_HOOK_INCLUDED = FALSE
+BTA_INCLUDED = TRUE
+BTA_AG_INCLUDED = TRUE
+BTA_CT_INCLUDED = FALSE
+BTA_CG_INCLUDED = FALSE
+BTA_DG_INCLUDED = FALSE
+BTA_FT_INCLUDED = FALSE
+BTA_OP_INCLUDED = FALSE
+BTA_PR_INCLUDED = FALSE
+BTA_SS_INCLUDED = FALSE
+BTA_DM_INCLUDED = TRUE
+BTA_DI_INCLUDED = FALSE
+BTA_BI_INCLUDED = FALSE
+BTA_SC_INCLUDED = FALSE
+BTA_PAN_INCLUDED = FALSE
+BTA_FS_INCLUDED = TRUE
+BTA_AC_INCLUDED = FALSE
+BTA_HD_INCLUDED = FALSE
+BTA_HH_INCLUDED = TRUE
+HH_USE_BTHID = TRUE
+BTA_AR_INCLUDED = TRUE
+BTA_AV_INCLUDED = TRUE
+BTA_AV_VDP_INCLUDED = FALSE
+BTA_AVK_INCLUDED = FALSE
+BTA_PBS_INCLUDED = FALSE
+BTA_PBC_INCLUDED = FALSE
+BTA_FM_INCLUDED = FALSE
+BTA_FM_DEBUG = FALSE
+BTA_FMTX_INCLUDED = FALSE
+BTA_FMTX_DEBUG = FALSE
+BTA_FMTX_FMRX_SWITCH_WORKAROUND = FALSE
+BTA_FMTX_US_FCC_RULES = FALSE
+BTA_HS_INCLUDED = FALSE
+BTA_MSE_INCLUDED = FALSE
+BTA_MCE_INCLUDED = FALSE
+BTA_PLAYBACK_INCLUDED = FALSE
+BTA_SSR_INCLUDED = FALSE
+BTA_JV_INCLUDED = FALSE
+BTA_EIR_CANNED_UUID_LIST = FALSE
+BTA_GATT_INCLUDED = FALSE
+RSI_INCLUDED = TRUE
+RPC_TRACE_ONLY = FALSE
+ANDROID_APP_INCLUDED = TRUE
+ANDROID_USE_LOGCAT = TRUE
+LINUX_GKI_INCLUDED = TRUE
+TICKS_PER_SEC = 100
+QUICK_TIMER_TICKS_PER_SEC = 10
+BTA_SYS_TIMER_PERIOD = 100
+GKI_BUF1_SIZE = 288
+GKI_BUF3_MAX = 200
+GKI_BUF3_SIZE = (4096+16)
+GKI_BUF4_SIZE = (8080+26)
+GKI_SHUTDOWN_EVT = APPL_EVT_7
+GKI_PTHREAD_JOINABLE = TRUE
+LINUX_DRV_INCLUDED = TRUE
+LINUX_OS = TRUE
+BTU_TASK = 0
+BTIF_TASK = 1
+A2DP_MEDIA_TASK = 2
+GKI_MAX_TASKS = 3
+BTM_APP_DEV_INIT = bte_main_post_reset_init
+BTE_IDLE_TASK_INCLUDED = FALSE
+APPL_INCLUDED = TRUE
+BTU_BTA_INCLUDED = TRUE
+SBC_FOR_EMBEDDED_LINUX = TRUE
+BTA_DM_REMOTE_DEVICE_NAME_LENGTH = 248
+BTM_MAX_REM_BD_NAME_LEN = 248
+BTM_MAX_LOC_BD_NAME_LEN = 248
+BTM_USE_DEF_LOCAL_NAME = TRUE
+BTM_DEF_LOCAL_NAME = "Galaxy Nexus 2"
+BTM_INQ_DB_SIZE = 40
+BTM_SEC_MAX_DEVICE_RECORDS = 100
+BTM_SEC_FORCE_RNR_FOR_DBOND = FALSE
+BTM_AUTOMATIC_HCI_RESET = FALSE
+AVDT_VERSION = 0x0102
+BTA_AG_AT_MAX_LEN = 512
+BTA_AVRCP_FF_RW_SUPPORT = TRUE
+BTM_MAX_SCO_LINKS = 2
+BTA_AG_SCO_PKT_TYPES = (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
+BTAPP_AV_SECMASK = (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
+BTA_AV_MAX_A2DP_MTU = 668
+BTA_AV_RET_TOUT = 15
+PORCHE_PAIRING_CONFLICT = TRUE
+BTA_AV_CO_CP_SCMS_T = FALSE
+AVDT_CONNECT_CP_ONLY = FALSE
+BTL_CFG_USE_CONF_FILE = FALSE
+BTAPP_AHF_API_SUPPORT = TRUE
+HCILP_INCLUDED = TRUE
+HCISU_H4_INCLUDED = TRUE
+BT_TRACE_PROTOCOL = TRUE
+BT_USE_TRACES = TRUE
+BT_TRACE_BTIF = TRUE
+BTTRC_INCLUDED = FALSE
+BT_TRACE_VERBOSE = FALSE
+BTTRC_PARSER_INCLUDED = FALSE
+MAX_TRACE_RAM_SIZE = 10000
+OBX_INITIAL_TRACE_LEVEL = BT_TRACE_LEVEL_ERROR
+BTM_ALLOW_CONN_IF_NONDISCOVER = TRUE
+BTAPP_DM_SUPPORTED_SERVICES = (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK)
+PBAP_ZERO_VCARD_IN_DB = FALSE
+BTA_DM_SDP_DB_SIZE = 4096
+MAX_L2CAP_CLIENTS = 15
+FTS_REJECT_INVALID_OBEX_SET_PATH_REQ = TRUE
+HID_HOST_MAX_CONN_RETRY = (3)
+BTM_DISC_DURING_RS = TRUE
+BTM_WBS_INCLUDED = FALSE
+HL_INCLUDED = FALSE
+NO_GKI_RUN_RETURN = TRUE
+AG_VOICE_SETTINGS = HCI_DEFAULT_VOICE_SETTINGS
diff --git a/include/bdroid_toro.txt b/include/bdroid_toro.txt
new file mode 100644
index 0000000..be0d03c
--- /dev/null
+++ b/include/bdroid_toro.txt
@@ -0,0 +1,197 @@
+AVCT_INCLUDED = TRUE
+AVRC_INCLUDED = TRUE
+AVRC_METADATA_INCLUDED = FALSE
+AVRC_ADV_CTRL_INCLUDED = FALSE
+AVDT_INCLUDED = TRUE
+UNV_INCLUDED = FALSE
+A2D_INCLUDED = TRUE
+A2D_SBC_INCLUDED = TRUE
+A2D_M12_INCLUDED = FALSE
+A2D_M24_INCLUDED = FALSE
+VDP_INCLUDED = FALSE
+VDP_H263_INCLUDED = FALSE
+VDP_MPEG_INCLUDED = FALSE
+VDP_VEND_INCLUDED = FALSE
+BIP_INCLUDED = FALSE
+BIP_INITR_INCLUDED = FALSE
+BIP_RSPDR_INCLUDED = FALSE
+BIP_PUSH_INCLUDED = FALSE
+BIP_PULL_INCLUDED = FALSE
+BIP_PRINTING_INCLUDED = FALSE
+BIP_ARCHIVE_INCLUDED = FALSE
+BIP_CAMERA_INCLUDED = FALSE
+BIP_DISPLAY_INCLUDED = FALSE
+BPP_INCLUDED = FALSE
+BPP_SND_INCLUDED = FALSE
+DUN_INCLUDED = FALSE
+GAP_INCLUDED = FALSE
+GOEP_INCLUDED = FALSE
+GOEP_FS_INCLUDED = FALSE
+GATT_PTS = FALSE
+BTM_SEC_MAX_SERVICE_RECORDS = 32
+L2CAP_INCLUDED = TRUE
+L2CAP_LINK_INACTIVITY_TOUT = 4
+L2CAP_FCR_INCLUDED = TRUE
+L2CAP_EXTFEA_SUPPORTED_MASK = (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
+OBX_INCLUDED = TRUE
+OBX_SERVER_INCLUDED = TRUE
+OBX_CLIENT_INCLUDED = TRUE
+OBX_MD5_INCLUDED = FALSE
+OBX_MD5_TEST_INCLUDED = FALSE
+OBX_14_INCLUDED = FALSE
+BTUI_OPS_FORMATS = (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
+BTA_OPC_SENDING_ABORT = TRUE
+RFCOMM_INCLUDED = TRUE
+MAX_RFC_PORTS = 30
+MAX_BD_CONNECTIONS = 7
+BTA_RFC_MTU_SIZE = (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
+PORT_TX_BUF_HIGH_WM = 10
+PORT_RX_BUF_HIGH_WM = 10
+PORT_RX_BUF_LOW_WM = 4
+PORT_RX_BUF_CRITICAL_WM = 15
+PORT_TX_BUF_CRITICAL_WM = 15
+PORT_RX_LOW_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
+PORT_RX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
+PORT_RX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
+PORT_TX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
+PORT_TX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
+BTA_DUN_MTU = BTA_RFC_MTU_SIZE
+BTA_SPP_MTU = BTA_RFC_MTU_SIZE
+BTA_FAX_MTU = BTA_RFC_MTU_SIZE
+SDP_DI_INCLUDED = TRUE
+SDP_RAW_DATA_INCLUDED = TRUE
+SDP_RAW_PDU_INCLUDED = TRUE
+SDP_POOL_ID = 3
+SDP_MAX_REC_ATTR = 25
+SDP_MAX_ATTR_LEN = 400
+SDP_MAX_PAD_LEN = 600
+BNEP_INCLUDED = FALSE
+PAN_INCLUDED = FALSE
+SAP_SERVER_INCLUDED = FALSE
+HID_DEV_INCLUDED = FALSE
+HID_HOST_INCLUDED = FALSE
+BLE_INCLUDED = FALSE
+BTM_BLE_CONFORMANCE_TESTING = FALSE
+ATT_INCLUDED = FALSE
+ATT_DEBUG = FALSE
+GATTS_APPU_USE_GATT_TRACE = FALSE
+GATT_CLIENT_ENABLED = FALSE
+GATT_SERVER_ENABLED = FALSE
+SMP_INCLUDED = FALSE
+SMP_HOST_ENCRYPT_INCLUDED = FALSE
+SER_INCLUDED = FALSE
+RPC_INCLUDED = FALSE
+MMI_INCLUDED = FALSE
+SAP_INCLUDED = FALSE
+SBC_NO_PCM_CPY_OPTION = FALSE
+SBC_IPAQ_OPT = FALSE
+SBC_IS_64_MULT_IN_QUANTIZER = FALSE
+BTE_HCIUTILS_HOOK_INCLUDED = FALSE
+BTA_INCLUDED = TRUE
+BTA_AG_INCLUDED = TRUE
+BTA_CT_INCLUDED = FALSE
+BTA_CG_INCLUDED = FALSE
+BTA_DG_INCLUDED = FALSE
+BTA_FT_INCLUDED = FALSE
+BTA_OP_INCLUDED = FALSE
+BTA_PR_INCLUDED = FALSE
+BTA_SS_INCLUDED = FALSE
+BTA_DM_INCLUDED = TRUE
+BTA_DI_INCLUDED = FALSE
+BTA_BI_INCLUDED = FALSE
+BTA_SC_INCLUDED = FALSE
+BTA_PAN_INCLUDED = FALSE
+BTA_FS_INCLUDED = TRUE
+BTA_AC_INCLUDED = FALSE
+BTA_HD_INCLUDED = FALSE
+BTA_HH_INCLUDED = FALSE
+HH_USE_BTHID = FALSE
+BTA_AR_INCLUDED = TRUE
+BTA_AV_INCLUDED = TRUE
+BTA_AV_VDP_INCLUDED = FALSE
+BTA_AVK_INCLUDED = FALSE
+BTA_PBS_INCLUDED = FALSE
+BTA_PBC_INCLUDED = FALSE
+BTA_FM_INCLUDED = FALSE
+BTA_FM_DEBUG = FALSE
+BTA_FMTX_INCLUDED = FALSE
+BTA_FMTX_DEBUG = FALSE
+BTA_FMTX_FMRX_SWITCH_WORKAROUND = FALSE
+BTA_FMTX_US_FCC_RULES = FALSE
+BTA_HS_INCLUDED = FALSE
+BTA_MSE_INCLUDED = FALSE
+BTA_MCE_INCLUDED = FALSE
+BTA_PLAYBACK_INCLUDED = FALSE
+BTA_SSR_INCLUDED = FALSE
+BTA_JV_INCLUDED = FALSE
+BTA_EIR_CANNED_UUID_LIST = FALSE
+BTA_GATT_INCLUDED = FALSE
+RSI_INCLUDED = TRUE
+RPC_TRACE_ONLY = FALSE
+ANDROID_APP_INCLUDED = TRUE
+ANDROID_USE_LOGCAT = TRUE
+LINUX_GKI_INCLUDED = TRUE
+TICKS_PER_SEC = 100
+QUICK_TIMER_TICKS_PER_SEC = 10
+BTA_SYS_TIMER_PERIOD = 100
+GKI_BUF1_SIZE = 288
+GKI_BUF3_MAX = 200
+GKI_BUF3_SIZE = (4096+16)
+GKI_BUF4_SIZE = (8080+26)
+GKI_SHUTDOWN_EVT = APPL_EVT_7
+GKI_PTHREAD_JOINABLE = TRUE
+LINUX_DRV_INCLUDED = TRUE
+LINUX_OS = TRUE
+BTU_TASK = 0
+BTIF_TASK = 1
+A2DP_MEDIA_TASK = 2
+GKI_MAX_TASKS = 3
+BTM_APP_DEV_INIT = bte_main_post_reset_init
+BTE_IDLE_TASK_INCLUDED = FALSE
+APPL_INCLUDED = TRUE
+BTU_BTA_INCLUDED = TRUE
+SBC_FOR_EMBEDDED_LINUX = TRUE
+BTA_DM_REMOTE_DEVICE_NAME_LENGTH = 248
+BTM_MAX_REM_BD_NAME_LEN = 248
+BTM_MAX_LOC_BD_NAME_LEN = 248
+BTM_USE_DEF_LOCAL_NAME = TRUE
+BTM_DEF_LOCAL_NAME = "Galaxy Nexus CDMA 2"
+BTM_INQ_DB_SIZE = 40
+BTM_SEC_MAX_DEVICE_RECORDS = 100
+BTM_SEC_FORCE_RNR_FOR_DBOND = FALSE
+BTM_AUTOMATIC_HCI_RESET = FALSE
+AVDT_VERSION = 0x0102
+BTA_AG_AT_MAX_LEN = 512
+BTA_AVRCP_FF_RW_SUPPORT = TRUE
+BTM_MAX_SCO_LINKS = 2
+BTA_AG_SCO_PKT_TYPES = (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
+BTAPP_AV_SECMASK = (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
+BTA_AV_MAX_A2DP_MTU = 668
+BTA_AV_RET_TOUT = 15
+PORCHE_PAIRING_CONFLICT = TRUE
+BTA_AV_CO_CP_SCMS_T = FALSE
+AVDT_CONNECT_CP_ONLY = FALSE
+BTL_CFG_USE_CONF_FILE = FALSE
+BTAPP_AHF_API_SUPPORT = TRUE
+HCILP_INCLUDED = TRUE
+HCISU_H4_INCLUDED = TRUE
+BT_TRACE_PROTOCOL = TRUE
+BT_USE_TRACES = TRUE
+BT_TRACE_BTIF = TRUE
+BTTRC_INCLUDED = FALSE
+BT_TRACE_VERBOSE = FALSE
+BTTRC_PARSER_INCLUDED = FALSE
+MAX_TRACE_RAM_SIZE = 10000
+OBX_INITIAL_TRACE_LEVEL = BT_TRACE_LEVEL_ERROR
+BTM_ALLOW_CONN_IF_NONDISCOVER = TRUE
+BTAPP_DM_SUPPORTED_SERVICES = (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK)
+PBAP_ZERO_VCARD_IN_DB = FALSE
+BTA_DM_SDP_DB_SIZE = 4096
+MAX_L2CAP_CLIENTS = 15
+FTS_REJECT_INVALID_OBEX_SET_PATH_REQ = TRUE
+HID_HOST_MAX_CONN_RETRY = (3)
+BTM_DISC_DURING_RS = TRUE
+BTM_WBS_INCLUDED = FALSE
+HL_INCLUDED = FALSE
+NO_GKI_RUN_RETURN = TRUE
+AG_VOICE_SETTINGS = HCI_DEFAULT_VOICE_SETTINGS
diff --git a/include/bdroid_wingray.txt b/include/bdroid_wingray.txt
new file mode 100644
index 0000000..8a8b204
--- /dev/null
+++ b/include/bdroid_wingray.txt
@@ -0,0 +1,197 @@
+AVCT_INCLUDED = TRUE
+AVRC_INCLUDED = TRUE
+AVRC_METADATA_INCLUDED = FALSE
+AVRC_ADV_CTRL_INCLUDED = FALSE
+AVDT_INCLUDED = TRUE
+UNV_INCLUDED = FALSE
+A2D_INCLUDED = TRUE
+A2D_SBC_INCLUDED = TRUE
+A2D_M12_INCLUDED = FALSE
+A2D_M24_INCLUDED = FALSE
+VDP_INCLUDED = FALSE
+VDP_H263_INCLUDED = FALSE
+VDP_MPEG_INCLUDED = FALSE
+VDP_VEND_INCLUDED = FALSE
+BIP_INCLUDED = FALSE
+BIP_INITR_INCLUDED = FALSE
+BIP_RSPDR_INCLUDED = FALSE
+BIP_PUSH_INCLUDED = FALSE
+BIP_PULL_INCLUDED = FALSE
+BIP_PRINTING_INCLUDED = FALSE
+BIP_ARCHIVE_INCLUDED = FALSE
+BIP_CAMERA_INCLUDED = FALSE
+BIP_DISPLAY_INCLUDED = FALSE
+BPP_INCLUDED = FALSE
+BPP_SND_INCLUDED = FALSE
+DUN_INCLUDED = FALSE
+GAP_INCLUDED = FALSE
+GOEP_INCLUDED = FALSE
+GOEP_FS_INCLUDED = FALSE
+GATT_PTS = FALSE
+BTM_SEC_MAX_SERVICE_RECORDS = 32
+L2CAP_INCLUDED = TRUE
+L2CAP_LINK_INACTIVITY_TOUT = 4
+L2CAP_FCR_INCLUDED = TRUE
+L2CAP_EXTFEA_SUPPORTED_MASK = (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
+OBX_INCLUDED = TRUE
+OBX_SERVER_INCLUDED = TRUE
+OBX_CLIENT_INCLUDED = TRUE
+OBX_MD5_INCLUDED = FALSE
+OBX_MD5_TEST_INCLUDED = FALSE
+OBX_14_INCLUDED = FALSE
+BTUI_OPS_FORMATS = (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
+BTA_OPC_SENDING_ABORT = TRUE
+RFCOMM_INCLUDED = TRUE
+MAX_RFC_PORTS = 30
+MAX_BD_CONNECTIONS = 7
+BTA_RFC_MTU_SIZE = (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
+PORT_TX_BUF_HIGH_WM = 10
+PORT_RX_BUF_HIGH_WM = 10
+PORT_RX_BUF_LOW_WM = 4
+PORT_RX_BUF_CRITICAL_WM = 15
+PORT_TX_BUF_CRITICAL_WM = 15
+PORT_RX_LOW_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
+PORT_RX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
+PORT_RX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
+PORT_TX_HIGH_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
+PORT_TX_CRITICAL_WM = (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
+BTA_DUN_MTU = BTA_RFC_MTU_SIZE
+BTA_SPP_MTU = BTA_RFC_MTU_SIZE
+BTA_FAX_MTU = BTA_RFC_MTU_SIZE
+SDP_DI_INCLUDED = TRUE
+SDP_RAW_DATA_INCLUDED = TRUE
+SDP_RAW_PDU_INCLUDED = TRUE
+SDP_POOL_ID = 3
+SDP_MAX_REC_ATTR = 25
+SDP_MAX_ATTR_LEN = 400
+SDP_MAX_PAD_LEN = 600
+BNEP_INCLUDED = FALSE
+PAN_INCLUDED = FALSE
+SAP_SERVER_INCLUDED = FALSE
+HID_DEV_INCLUDED = FALSE
+HID_HOST_INCLUDED = FALSE
+BLE_INCLUDED = FALSE
+BTM_BLE_CONFORMANCE_TESTING = FALSE
+ATT_INCLUDED = FALSE
+ATT_DEBUG = FALSE
+GATTS_APPU_USE_GATT_TRACE = FALSE
+GATT_CLIENT_ENABLED = FALSE
+GATT_SERVER_ENABLED = FALSE
+SMP_INCLUDED = FALSE
+SMP_HOST_ENCRYPT_INCLUDED = FALSE
+SER_INCLUDED = FALSE
+RPC_INCLUDED = FALSE
+MMI_INCLUDED = FALSE
+SAP_INCLUDED = FALSE
+SBC_NO_PCM_CPY_OPTION = FALSE
+SBC_IPAQ_OPT = FALSE
+SBC_IS_64_MULT_IN_QUANTIZER = FALSE
+BTE_HCIUTILS_HOOK_INCLUDED = FALSE
+BTA_INCLUDED = TRUE
+BTA_AG_INCLUDED = TRUE
+BTA_CT_INCLUDED = FALSE
+BTA_CG_INCLUDED = FALSE
+BTA_DG_INCLUDED = FALSE
+BTA_FT_INCLUDED = FALSE
+BTA_OP_INCLUDED = FALSE
+BTA_PR_INCLUDED = FALSE
+BTA_SS_INCLUDED = FALSE
+BTA_DM_INCLUDED = TRUE
+BTA_DI_INCLUDED = FALSE
+BTA_BI_INCLUDED = FALSE
+BTA_SC_INCLUDED = FALSE
+BTA_PAN_INCLUDED = FALSE
+BTA_FS_INCLUDED = TRUE
+BTA_AC_INCLUDED = FALSE
+BTA_HD_INCLUDED = FALSE
+BTA_HH_INCLUDED = FALSE
+HH_USE_BTHID = FALSE
+BTA_AR_INCLUDED = TRUE
+BTA_AV_INCLUDED = TRUE
+BTA_AV_VDP_INCLUDED = FALSE
+BTA_AVK_INCLUDED = FALSE
+BTA_PBS_INCLUDED = FALSE
+BTA_PBC_INCLUDED = FALSE
+BTA_FM_INCLUDED = FALSE
+BTA_FM_DEBUG = FALSE
+BTA_FMTX_INCLUDED = FALSE
+BTA_FMTX_DEBUG = FALSE
+BTA_FMTX_FMRX_SWITCH_WORKAROUND = FALSE
+BTA_FMTX_US_FCC_RULES = FALSE
+BTA_HS_INCLUDED = FALSE
+BTA_MSE_INCLUDED = FALSE
+BTA_MCE_INCLUDED = FALSE
+BTA_PLAYBACK_INCLUDED = FALSE
+BTA_SSR_INCLUDED = FALSE
+BTA_JV_INCLUDED = FALSE
+BTA_EIR_CANNED_UUID_LIST = FALSE
+BTA_GATT_INCLUDED = FALSE
+RSI_INCLUDED = TRUE
+RPC_TRACE_ONLY = FALSE
+ANDROID_APP_INCLUDED = TRUE
+ANDROID_USE_LOGCAT = TRUE
+LINUX_GKI_INCLUDED = TRUE
+TICKS_PER_SEC = 100
+QUICK_TIMER_TICKS_PER_SEC = 10
+BTA_SYS_TIMER_PERIOD = 100
+GKI_BUF1_SIZE = 288
+GKI_BUF3_MAX = 100
+GKI_BUF3_SIZE = (4096+16)
+GKI_BUF4_SIZE = (8080+26)
+GKI_SHUTDOWN_EVT = APPL_EVT_7
+GKI_PTHREAD_JOINABLE = TRUE
+LINUX_DRV_INCLUDED = TRUE
+LINUX_OS = TRUE
+BTU_TASK = 0
+BTIF_TASK = 1
+A2DP_MEDIA_TASK = 2
+GKI_MAX_TASKS = 3
+BTM_APP_DEV_INIT = bte_main_post_reset_init
+BTE_IDLE_TASK_INCLUDED = FALSE
+APPL_INCLUDED = TRUE
+BTU_BTA_INCLUDED = TRUE
+SBC_FOR_EMBEDDED_LINUX = TRUE
+BTA_DM_REMOTE_DEVICE_NAME_LENGTH = 248
+BTM_MAX_REM_BD_NAME_LEN = 248
+BTM_MAX_LOC_BD_NAME_LEN = 248
+BTM_USE_DEF_LOCAL_NAME = TRUE
+BTM_DEF_LOCAL_NAME = "Xoom 2"
+BTM_INQ_DB_SIZE = 40
+BTM_SEC_MAX_DEVICE_RECORDS = 100
+BTM_SEC_FORCE_RNR_FOR_DBOND = FALSE
+BTM_AUTOMATIC_HCI_RESET = FALSE
+AVDT_VERSION = 0x0102
+BTA_AG_AT_MAX_LEN = 512
+BTA_AVRCP_FF_RW_SUPPORT = TRUE
+BTM_MAX_SCO_LINKS = 2
+BTA_AG_SCO_PKT_TYPES = (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
+BTAPP_AV_SECMASK = (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
+BTA_AV_MAX_A2DP_MTU = 668
+BTA_AV_RET_TOUT = 15
+PORCHE_PAIRING_CONFLICT = TRUE
+BTA_AV_CO_CP_SCMS_T = FALSE
+AVDT_CONNECT_CP_ONLY = FALSE
+BTL_CFG_USE_CONF_FILE = FALSE
+BTAPP_AHF_API_SUPPORT = TRUE
+HCILP_INCLUDED = TRUE
+HCISU_H4_INCLUDED = TRUE
+BT_TRACE_PROTOCOL = TRUE
+BT_USE_TRACES = TRUE
+BT_TRACE_BTIF = TRUE
+BTTRC_INCLUDED = FALSE
+BT_TRACE_VERBOSE = FALSE
+BTTRC_PARSER_INCLUDED = FALSE
+MAX_TRACE_RAM_SIZE = 10000
+OBX_INITIAL_TRACE_LEVEL = BT_TRACE_LEVEL_ERROR
+BTM_ALLOW_CONN_IF_NONDISCOVER = TRUE
+BTAPP_DM_SUPPORTED_SERVICES = (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK)
+PBAP_ZERO_VCARD_IN_DB = FALSE
+BTA_DM_SDP_DB_SIZE = 4096
+MAX_L2CAP_CLIENTS = 15
+FTS_REJECT_INVALID_OBEX_SET_PATH_REQ = TRUE
+HID_HOST_MAX_CONN_RETRY = (3)
+BTM_DISC_DURING_RS = TRUE
+BTM_WBS_INCLUDED = FALSE
+HL_INCLUDED = FALSE
+NO_GKI_RUN_RETURN = TRUE
+AG_VOICE_SETTINGS = HCI_DEFAULT_VOICE_SETTINGS
diff --git a/include/bt_trace.h b/include/bt_trace.h
index a5372d0..6ad87c8 100644
--- a/include/bt_trace.h
+++ b/include/bt_trace.h
@@ -157,21 +157,15 @@ typedef struct {
typedef UINT8 (tBTTRC_SET_TRACE_LEVEL)( UINT8 );
-/* potentially to save flash, you could compile this out. however some functions may need adjustments! */
-#ifndef USE_TEXT_ID
-#define USE_TEXT_ID TRUE
-#endif
-
typedef struct {
const tBTTRC_LAYER_ID layer_id_start;
const tBTTRC_LAYER_ID layer_id_end;
- const tBTTRC_SET_TRACE_LEVEL *p_f;
-#if (USE_TEXT_ID==TRUE)
+ tBTTRC_SET_TRACE_LEVEL *p_f;
const char *trc_name;
-#endif
+ UINT8 trace_level;
} tBTTRC_FUNC_MAP;
-extern const tBTTRC_FUNC_MAP bttrc_set_level_map[];
+extern tBTTRC_FUNC_MAP bttrc_set_level_map[];
extern const UINT16 bttrc_map_size;
extern BT_API tBTTRC_LEVEL * BTA_SysSetTraceLevel( tBTTRC_LEVEL * p_levels );
// btla-specific --
diff --git a/include/buildcfg.h b/include/buildcfg.h
deleted file mode 100644
index 773f0b3..0000000
--- a/include/buildcfg.h
+++ /dev/null
@@ -1,6 +0,0 @@
-//Based on the target variant one of these would be picked
-#ifdef TARGET_CRESPO
-#include "buildcfg_crespo.h"
-#else
-#include "buildcfg_maguro.h"
-#endif
diff --git a/include/buildcfg.mk b/include/buildcfg.mk
new file mode 100644
index 0000000..8d53748
--- /dev/null
+++ b/include/buildcfg.mk
@@ -0,0 +1,13 @@
+#bt_targetfile = $(TARGET_DEVICE_DIR)/$(addprefix bdroid_, $(addsuffix .txt,$(basename $(TARGET_DEVICE))))
+bt_targetfile = $(call my-dir)/$(addprefix bdroid_, $(addsuffix .txt,$(basename $(TARGET_DEVICE))))
+bt_cfgfile = $(call my-dir)/buildcfg.h
+
+bt_build_cfg = $(shell if [ -f $(bt_cfgfile) ] && [ `stat -c %Y $(bt_targetfile)` -lt `stat -c %Y $(bt_cfgfile)` ]; then echo 0; else echo 1; fi)
+
+ifeq ($(bt_build_cfg),1)
+$(info "Creating $(bt_cfgfile) from $(bt_targetfile)")
+$(shell echo "#ifndef BUILDCFG_H" > $(bt_cfgfile))
+$(shell echo "#define BUILDCFG_H" >> $(bt_cfgfile))
+$(shell sed -e '/^#/d' -e '/^$$/d' -e '/# Makefile only$$/d' -e 's/^/#define /' -e 's/=/ /' $(bt_targetfile) >> $(bt_cfgfile))
+$(shell echo "#endif" >> $(bt_cfgfile))
+endif
diff --git a/include/buildcfg_crespo.h b/include/buildcfg_crespo.h
deleted file mode 100644
index da4d475..0000000
--- a/include/buildcfg_crespo.h
+++ /dev/null
@@ -1,237 +0,0 @@
-#ifndef BUILDCFG_H
-#define BUILDCFG_H
-#define AVCT_INCLUDED TRUE
-#define AVRC_INCLUDED TRUE
-#define AVRC_METADATA_INCLUDED FALSE
-#define AVRC_ADV_CTRL_INCLUDED FALSE
-#define AVDT_INCLUDED TRUE
-#define AVDTC_INCLUDED FALSE # Makefile only
-#define AT91_MAIN_INCLUDED FALSE
-#define AT91_DRV_INCLUDED FALSE
-#define AT91_LIB_INCLUDED FALSE
-#define AT91_GKI_INCLUDED FALSE
-#define UNV_INCLUDED FALSE
-#define BBY_MAIN_INCLUDED FALSE
-#define A2D_INCLUDED TRUE
-#define A2D_SBC_INCLUDED TRUE
-#define A2D_M12_INCLUDED FALSE
-#define A2D_M24_INCLUDED FALSE
-#define VDP_H263_INCLUDED FALSE
-#define VDP_MPEG_INCLUDED FALSE
-#define VDP_VEND_INCLUDED FALSE
-#define BIP_INCLUDED FALSE
-#define BIP_INITR_INCLUDED FALSE
-#define BIP_RSPDR_INCLUDED FALSE
-#define BIP_PUSH_INCLUDED FALSE
-#define BIP_PULL_INCLUDED FALSE
-#define BIP_PRINTING_INCLUDED FALSE
-#define BIP_ARCHIVE_INCLUDED FALSE
-#define BIP_CAMERA_INCLUDED FALSE
-#define BIP_DISPLAY_INCLUDED FALSE
-#define BPP_INCLUDED FALSE
-#define BPP_SND_INCLUDED FALSE
-#define BTM_INCLUDED FALSE # Makefile only
-#define BTU_INCLUDED FALSE # Makefile only
-#define BTUTHIN_INCLUDED FALSE # Makefile only
-#define DUN_INCLUDED FALSE
-#define GAP_INCLUDED FALSE
-#define GOEP_INCLUDED FALSE
-#define GOEP_FS_INCLUDED FALSE
-#define GATT_PTS FALSE
-#define HCIC_INCLUDED TRUE # Makefile only
-#define HCITHIN_INCLUDED FALSE
-#define BTM_SEC_MAX_SERVICE_RECORDS 32
-#define L2CAP_INCLUDED TRUE
-#define L2CAP_LINK_INACTIVITY_TOUT 4
-#define L2CAP_FCR_INCLUDED TRUE
-#define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
-#define OBX_INCLUDED TRUE
-#define OBX_SERVER_INCLUDED TRUE
-#define OBX_CLIENT_INCLUDED TRUE
-#define OBX_MD5_INCLUDED FALSE
-#define OBX_MD5_TEST_INCLUDED FALSE
-#define OBX_14_INCLUDED FALSE
-#define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
-#define BTA_OPC_SENDING_ABORT TRUE
-#define RFCOMM_INCLUDED TRUE
-#define MAX_RFC_PORTS 30
-#define MAX_BD_CONNECTIONS 7
-#define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
-#define PORT_TX_BUF_HIGH_WM 10
-#define PORT_RX_BUF_HIGH_WM 10
-#define PORT_RX_BUF_LOW_WM 4
-#define PORT_RX_BUF_CRITICAL_WM 15
-#define PORT_TX_BUF_CRITICAL_WM 15
-#define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
-#define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
-#define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
-#define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
-#define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
-#define BTA_DUN_MTU BTA_RFC_MTU_SIZE
-#define BTA_SPP_MTU BTA_RFC_MTU_SIZE
-#define BTA_FAX_MTU BTA_RFC_MTU_SIZE
-#define SDP_INCLUDED TRUE # Makefile only
-#define SDP_DI_INCLUDED TRUE
-#define SDP_RAW_DATA_INCLUDED TRUE
-#define SDP_RAW_PDU_INCLUDED TRUE
-#define SDP_POOL_ID 3
-#define SDP_MAX_REC_ATTR 25
-#define SDP_MAX_ATTR_LEN 400
-#define SDP_MAX_PAD_LEN 600
-#define XML_INCLUDED TRUE # Makefile only
-#define BNEP_INCLUDED FALSE
-#define PAN_INCLUDED FALSE
-#define ANT_INCLUDED FALSE
-#define SAP_SERVER_INCLUDED FALSE
-#define HID_DEV_INCLUDED FALSE
-#define HID_HOST_INCLUDED FALSE
-#define BLE_INCLUDED FALSE
-#define BTM_BLE_CONFORMANCE_TESTING FALSE
-#define ATT_INCLUDED FALSE
-#define ATT_DEBUG FALSE
-#define GATTS_APPU_USE_GATT_TRACE FALSE
-#define GATT_CLIENT_ENABLED FALSE
-#define GATT_SERVER_ENABLED FALSE
-#define SMP_INCLUDED FALSE
-#define SMP_HOST_ENCRYPT_INCLUDED FALSE
-#define CE_TEST_INCLUDED FALSE
-#define FLASHEXE_INCLUDED TRUE # Makefile only
-#define SER_INCLUDED FALSE
-#define RPC_INCLUDED FALSE
-#define HSA_INCLUDED FALSE # Makefile only
-#define MMI_INCLUDED FALSE
-#define SAP_INCLUDED FALSE
-#define SBC_ENCODER_INCLUDED FALSE # Makefile only
-#define SBC_DECODER_INCLUDED FALSE # Makefile only
-#define SBC_NO_PCM_CPY_OPTION FALSE
-#define SBC_IPAQ_OPT FALSE
-#define SBC_IS_64_MULT_IN_QUANTIZER FALSE
-#define BTE_HCIUTILS_HOOK_INCLUDED FALSE
-#define BTA_INCLUDED TRUE
-#define BTA_AG_INCLUDED TRUE
-#define BTA_CT_INCLUDED FALSE
-#define BTA_CG_INCLUDED FALSE
-#define BTA_DG_INCLUDED FALSE
-#define BTA_FT_INCLUDED FALSE
-#define BTA_OP_INCLUDED FALSE
-#define BTA_PR_INCLUDED FALSE
-#define BTA_SS_INCLUDED FALSE
-#define BTA_DM_INCLUDED TRUE
-#define BTA_DI_INCLUDED FALSE
-#define BTA_BI_INCLUDED FALSE
-#define BTA_SC_INCLUDED FALSE
-#define BTA_PAN_INCLUDED FALSE
-#define BTA_FS_INCLUDED TRUE
-#define BTA_AC_INCLUDED FALSE
-#define BTA_HD_INCLUDED FALSE
-#define BTA_HH_INCLUDED FALSE
-#define HH_USE_BTHID FALSE
-#define BTA_AR_INCLUDED TRUE
-#define BTA_AV_INCLUDED TRUE
-#define BTA_PBS_INCLUDED FALSE
-#define BTA_PBC_INCLUDED FALSE
-#define BTA_FM_INCLUDED FALSE
-#define BTA_FM_DEBUG FALSE
-#define BTA_FMTX_INCLUDED FALSE
-#define BTA_FMTX_DEBUG FALSE
-#define BTA_FMTX_FMRX_SWITCH_WORKAROUND FALSE
-#define BTA_FMTX_US_FCC_RULES FALSE
-#define BTA_HS_INCLUDED FALSE
-#define BTA_MSE_INCLUDED FALSE
-#define BTA_MCE_INCLUDED FALSE
-#define BTA_PLAYBACK_INCLUDED FALSE
-#define BTA_SSR_INCLUDED FALSE
-#define BTA_JV_INCLUDED FALSE
-#define BTA_EIR_CANNED_UUID_LIST FALSE
-#define BTA_GATT_INCLUDED FALSE
-#define MMP_INCLUDED FALSE # Makefile only
-#define BTELIB_INCLUDED FALSE # Makefile only
-#define RSI_INCLUDED TRUE
-#define RPC_TRACE_ONLY FALSE
-#define ANDROID_APP_INCLUDED TRUE
-#define ANDROID_USE_LOGCAT TRUE
-#define LINUX_GKI_INCLUDED TRUE
-#define TICKS_PER_SEC 100
-#define QUICK_TIMER_TICKS_PER_SEC 10
-#define BTA_SYS_TIMER_PERIOD 100
-#define GKI_BUF1_SIZE 288
-#define GKI_BUF3_MAX 200
-#define GKI_BUF3_SIZE (4096+16)
-#define GKI_BUF4_SIZE (8080+26)
-#define GKI_SHUTDOWN_EVT APPL_EVT_7
-#define GKI_PTHREAD_JOINABLE TRUE
-#define LINUX_DRV_INCLUDED TRUE
-#define LINUX_OS TRUE
-#define BTU_TASK 0
-#define BTIF_TASK 1
-#define A2DP_MEDIA_TASK 2
-#define GKI_MAX_TASKS 3
-#define BTM_APP_DEV_INIT bte_main_post_reset_init
-#define BTE_IDLE_TASK_INCLUDED FALSE
-#define APPL_INCLUDED TRUE
-#define USE_UART_HCI TRUE
-#define BTU_BTA_INCLUDED TRUE
-#define BTUI_DEFAULT_LOCAL_NAME "BRCM Bluetooth"
-#define SBC_FOR_EMBEDDED_LINUX TRUE
-#define UPIO_INCLUDED TRUE
-#define BTA_DM_REMOTE_DEVICE_NAME_LENGTH 248
-#define BTM_MAX_REM_BD_NAME_LEN 248
-#define BTM_MAX_LOC_BD_NAME_LEN 248
-#define BTM_USE_DEF_LOCAL_NAME TRUE
-#define BTM_DEF_LOCAL_NAME "Galaxy Nexus BlueDroid"
-#define BTM_INQ_DB_SIZE 40
-#define BTM_SEC_MAX_DEVICE_RECORDS 100
-#define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
-#define BTM_AUTOMATIC_HCI_RESET FALSE
-#define AVDT_VERSION 0x0102
-#define BTA_SIMUL_AV_HFP_NOT_SUPPORTED TRUE
-#define BTA_AG_AT_MAX_LEN 512
-#define BTA_AVRCP_FF_RW_SUPPORT TRUE
-#define BTM_MAX_SCO_LINKS 2
-#define BTA_AG_SCO_PKT_TYPES (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
-#define BTAPP_AV_SECMASK (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
-#define BTA_AV_MAX_A2DP_MTU 668
-#define BTA_AV_RET_TOUT 15
-#define PORCHE_PAIRING_CONFLICT TRUE
-#define BTA_AV_CO_CP_SCMS_T FALSE
-#define AVDT_CONNECT_CP_ONLY FALSE
-#define BTL_CFG_USE_CONF_FILE FALSE
-#define BTAPP_AHF_API_SUPPORT TRUE
-#define BTAPP_TESTMODE_INCLUDED TRUE
-#define HCILP_INCLUDED TRUE
-#define HCISU_H4_INCLUDED TRUE
-#define BT_USE_TRACES TRUE
-#define BT_TRACE_BTIF TRUE
-#define BTTRC_INCLUDED FALSE
-#define BT_TRACE_VERBOSE FALSE
-#define BTTRC_PARSER_INCLUDED FALSE
-#define MAX_TRACE_RAM_SIZE 10000
-#define OBX_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_ERROR
-//#define LOG_NDEBUG 1
-//#define LOG_NDDEBUG 1
-//#define LOG_NIDEBUG 1
-#define BTSNOOPDISP_INCLUDED TRUE
-#define BTSNOOP_FILENAME "/data/misc/bluedroid/btsnoop_hci.log"
-#define SNOOP_CONFIG_PATH "/data/misc/bluedroid/btsnoop_enabled"
-#define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
-#define BTLA_REL_2_X TRUE
-#define BTAPP_FM_USE_HW_POKE_VOLUME FALSE
-#define BTAPP_FM_AUDIO_PATH BTA_FM_AUDIO_DAC
-#define BTAPP_DM_SUPPORTED_SERVICES (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK | BTA_NAP_SERVICE_MASK | BTA_PANU_SERVICE_MASK | BTA_HL_SERVICE_MASK)
-#define PBAP_ZERO_VCARD_IN_DB FALSE
-#define BTA_DM_SDP_DB_SIZE 4096
-#define BTA_BUSAPP_INCLUDED TRUE
-#define MAX_L2CAP_CLIENTS 15
-#define FTS_REJECT_INVALID_OBEX_SET_PATH_REQ TRUE
-#define HID_HOST_MAX_CONN_RETRY (3)
-#define BTAPP_TEST_OOB_INCLUDED TRUE
-#define ENABLE_PCM_LOGGER FALSE
-#define BTM_DISC_DURING_RS TRUE
-#define BT_UART_PORT "/dev/s3c2410_serial0"
-#define BTM_WBS_INCLUDED FALSE
-#define HL_INCLUDED FALSE
-#define NO_GKI_RUN_RETURN TRUE
-#define BTE_MAIN_CFG_DEFAULT_PATCHFILE_NAME ("/vendor/firmware/bcm4329.hcd")
-#define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
-#endif
-
diff --git a/include/buildcfg_maguro.h b/include/buildcfg_maguro.h
deleted file mode 100644
index 310af2d..0000000
--- a/include/buildcfg_maguro.h
+++ /dev/null
@@ -1,235 +0,0 @@
-#ifndef BUILDCFG_H
-#define BUILDCFG_H
-#define AVCT_INCLUDED TRUE
-#define AVRC_INCLUDED TRUE
-#define AVRC_METADATA_INCLUDED FALSE
-#define AVRC_ADV_CTRL_INCLUDED FALSE
-#define AVDT_INCLUDED TRUE
-#define AVDTC_INCLUDED FALSE # Makefile only
-#define AT91_MAIN_INCLUDED FALSE
-#define AT91_DRV_INCLUDED FALSE
-#define AT91_LIB_INCLUDED FALSE
-#define AT91_GKI_INCLUDED FALSE
-#define UNV_INCLUDED FALSE
-#define BBY_MAIN_INCLUDED FALSE
-#define A2D_INCLUDED TRUE
-#define A2D_SBC_INCLUDED TRUE
-#define A2D_M12_INCLUDED FALSE
-#define A2D_M24_INCLUDED FALSE
-#define VDP_H263_INCLUDED FALSE
-#define VDP_MPEG_INCLUDED FALSE
-#define VDP_VEND_INCLUDED FALSE
-#define BIP_INCLUDED FALSE
-#define BIP_INITR_INCLUDED FALSE
-#define BIP_RSPDR_INCLUDED FALSE
-#define BIP_PUSH_INCLUDED FALSE
-#define BIP_PULL_INCLUDED FALSE
-#define BIP_PRINTING_INCLUDED FALSE
-#define BIP_ARCHIVE_INCLUDED FALSE
-#define BIP_CAMERA_INCLUDED FALSE
-#define BIP_DISPLAY_INCLUDED FALSE
-#define BPP_INCLUDED FALSE
-#define BPP_SND_INCLUDED FALSE
-#define BTM_INCLUDED FALSE # Makefile only
-#define BTU_INCLUDED FALSE # Makefile only
-#define BTUTHIN_INCLUDED FALSE # Makefile only
-#define DUN_INCLUDED FALSE
-#define GAP_INCLUDED FALSE
-#define GOEP_INCLUDED FALSE
-#define GOEP_FS_INCLUDED FALSE
-#define GATT_PTS FALSE
-#define HCIC_INCLUDED TRUE # Makefile only
-#define HCITHIN_INCLUDED FALSE
-#define BTM_SEC_MAX_SERVICE_RECORDS 32
-#define L2CAP_INCLUDED TRUE
-#define L2CAP_LINK_INACTIVITY_TOUT 4
-#define L2CAP_FCR_INCLUDED TRUE
-#define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
-#define OBX_INCLUDED TRUE
-#define OBX_SERVER_INCLUDED TRUE
-#define OBX_CLIENT_INCLUDED TRUE
-#define OBX_MD5_INCLUDED FALSE
-#define OBX_MD5_TEST_INCLUDED FALSE
-#define OBX_14_INCLUDED FALSE
-#define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_VCAL_MASK | BTA_OP_VNOTE_MASK | BTA_OP_ANY_MASK)
-#define BTA_OPC_SENDING_ABORT TRUE
-#define RFCOMM_INCLUDED TRUE
-#define MAX_RFC_PORTS 30
-#define MAX_BD_CONNECTIONS 7
-#define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
-#define PORT_TX_BUF_HIGH_WM 10
-#define PORT_RX_BUF_HIGH_WM 10
-#define PORT_RX_BUF_LOW_WM 4
-#define PORT_RX_BUF_CRITICAL_WM 15
-#define PORT_TX_BUF_CRITICAL_WM 15
-#define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
-#define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
-#define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
-#define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
-#define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
-#define BTA_DUN_MTU BTA_RFC_MTU_SIZE
-#define BTA_SPP_MTU BTA_RFC_MTU_SIZE
-#define BTA_FAX_MTU BTA_RFC_MTU_SIZE
-#define SDP_INCLUDED TRUE # Makefile only
-#define SDP_DI_INCLUDED TRUE
-#define SDP_RAW_DATA_INCLUDED TRUE
-#define SDP_RAW_PDU_INCLUDED TRUE
-#define SDP_POOL_ID 3
-#define SDP_MAX_REC_ATTR 25
-#define SDP_MAX_ATTR_LEN 400
-#define SDP_MAX_PAD_LEN 600
-#define XML_INCLUDED TRUE # Makefile only
-#define BNEP_INCLUDED FALSE
-#define PAN_INCLUDED FALSE
-#define ANT_INCLUDED FALSE
-#define SAP_SERVER_INCLUDED FALSE
-#define HID_DEV_INCLUDED FALSE
-#define HID_HOST_INCLUDED TRUE
-#define BLE_INCLUDED FALSE
-#define BTM_BLE_CONFORMANCE_TESTING FALSE
-#define ATT_INCLUDED FALSE
-#define ATT_DEBUG FALSE
-#define GATTS_APPU_USE_GATT_TRACE FALSE
-#define GATT_CLIENT_ENABLED FALSE
-#define GATT_SERVER_ENABLED FALSE
-#define SMP_INCLUDED FALSE
-#define SMP_HOST_ENCRYPT_INCLUDED FALSE
-#define CE_TEST_INCLUDED FALSE
-#define FLASHEXE_INCLUDED TRUE # Makefile only
-#define SER_INCLUDED FALSE
-#define RPC_INCLUDED FALSE
-#define HSA_INCLUDED FALSE # Makefile only
-#define MMI_INCLUDED FALSE
-#define SAP_INCLUDED FALSE
-#define SBC_ENCODER_INCLUDED FALSE # Makefile only
-#define SBC_DECODER_INCLUDED FALSE # Makefile only
-#define SBC_NO_PCM_CPY_OPTION FALSE
-#define SBC_IPAQ_OPT FALSE
-#define SBC_IS_64_MULT_IN_QUANTIZER FALSE
-#define BTE_HCIUTILS_HOOK_INCLUDED FALSE
-#define BTA_INCLUDED TRUE
-#define BTA_AG_INCLUDED TRUE
-#define BTA_CT_INCLUDED FALSE
-#define BTA_CG_INCLUDED FALSE
-#define BTA_DG_INCLUDED FALSE
-#define BTA_FT_INCLUDED FALSE
-#define BTA_OP_INCLUDED FALSE
-#define BTA_PR_INCLUDED FALSE
-#define BTA_SS_INCLUDED FALSE
-#define BTA_DM_INCLUDED TRUE
-#define BTA_DI_INCLUDED FALSE
-#define BTA_BI_INCLUDED FALSE
-#define BTA_SC_INCLUDED FALSE
-#define BTA_PAN_INCLUDED FALSE
-#define BTA_FS_INCLUDED TRUE
-#define BTA_AC_INCLUDED FALSE
-#define BTA_HD_INCLUDED FALSE
-#define BTA_HH_INCLUDED TRUE
-#define HH_USE_BTHID TRUE
-#define BTA_AR_INCLUDED TRUE
-#define BTA_AV_INCLUDED TRUE
-#define BTA_PBS_INCLUDED FALSE
-#define BTA_PBC_INCLUDED FALSE
-#define BTA_FM_INCLUDED FALSE
-#define BTA_FM_DEBUG FALSE
-#define BTA_FMTX_INCLUDED FALSE
-#define BTA_FMTX_DEBUG FALSE
-#define BTA_FMTX_FMRX_SWITCH_WORKAROUND FALSE
-#define BTA_FMTX_US_FCC_RULES FALSE
-#define BTA_HS_INCLUDED FALSE
-#define BTA_MSE_INCLUDED FALSE
-#define BTA_MCE_INCLUDED FALSE
-#define BTA_PLAYBACK_INCLUDED FALSE
-#define BTA_SSR_INCLUDED FALSE
-#define BTA_JV_INCLUDED FALSE
-#define BTA_EIR_CANNED_UUID_LIST FALSE
-#define BTA_GATT_INCLUDED FALSE
-#define MMP_INCLUDED FALSE # Makefile only
-#define BTELIB_INCLUDED FALSE # Makefile only
-#define RSI_INCLUDED TRUE
-#define RPC_TRACE_ONLY FALSE
-#define ANDROID_APP_INCLUDED TRUE
-#define ANDROID_USE_LOGCAT TRUE
-#define LINUX_GKI_INCLUDED TRUE
-#define TICKS_PER_SEC 100
-#define QUICK_TIMER_TICKS_PER_SEC 10
-#define BTA_SYS_TIMER_PERIOD 100
-#define GKI_BUF1_SIZE 288
-#define GKI_BUF3_MAX 200
-#define GKI_BUF3_SIZE (4096+16)
-#define GKI_BUF4_SIZE (8080+26)
-#define GKI_SHUTDOWN_EVT APPL_EVT_7
-#define GKI_PTHREAD_JOINABLE TRUE
-#define LINUX_DRV_INCLUDED TRUE
-#define LINUX_OS TRUE
-#define BTU_TASK 0
-#define BTIF_TASK 1
-#define A2DP_MEDIA_TASK 2
-#define GKI_MAX_TASKS 3
-#define BTM_APP_DEV_INIT bte_main_post_reset_init
-#define BTE_IDLE_TASK_INCLUDED FALSE
-#define APPL_INCLUDED TRUE
-#define USE_UART_HCI TRUE
-#define BTU_BTA_INCLUDED TRUE
-#define BTUI_DEFAULT_LOCAL_NAME "BRCM Bluetooth"
-#define SBC_FOR_EMBEDDED_LINUX TRUE
-#define UPIO_INCLUDED TRUE
-#define BTA_DM_REMOTE_DEVICE_NAME_LENGTH 248
-#define BTM_MAX_REM_BD_NAME_LEN 248
-#define BTM_MAX_LOC_BD_NAME_LEN 248
-#define BTM_USE_DEF_LOCAL_NAME TRUE
-#define BTM_DEF_LOCAL_NAME "Galaxy Nexus BlueDroid"
-#define BTM_INQ_DB_SIZE 40
-#define BTM_SEC_MAX_DEVICE_RECORDS 100
-#define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
-#define BTM_AUTOMATIC_HCI_RESET FALSE
-#define AVDT_VERSION 0x0102
-#define BTA_SIMUL_AV_HFP_NOT_SUPPORTED TRUE
-#define BTA_AG_AT_MAX_LEN 512
-#define BTA_AVRCP_FF_RW_SUPPORT TRUE
-#define BTM_MAX_SCO_LINKS 2
-#define BTA_AG_SCO_PKT_TYPES (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
-#define BTAPP_AV_SECMASK (BTA_SEC_AUTHENTICATE | BTA_SEC_AUTHORIZE)
-#define BTA_AV_MAX_A2DP_MTU 668
-#define BTA_AV_RET_TOUT 15
-#define PORCHE_PAIRING_CONFLICT TRUE
-#define BTA_AV_CO_CP_SCMS_T FALSE
-#define AVDT_CONNECT_CP_ONLY FALSE
-#define BTL_CFG_USE_CONF_FILE FALSE
-#define BTAPP_AHF_API_SUPPORT TRUE
-#define BTAPP_TESTMODE_INCLUDED TRUE
-#define HCILP_INCLUDED TRUE
-#define HCISU_H4_INCLUDED TRUE
-#define BT_USE_TRACES TRUE
-#define BT_TRACE_BTIF TRUE
-#define BTTRC_INCLUDED FALSE
-#define BT_TRACE_VERBOSE FALSE
-#define BTTRC_PARSER_INCLUDED FALSE
-#define MAX_TRACE_RAM_SIZE 10000
-#define OBX_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_ERROR
-//#define LOG_NDEBUG 1
-//#define LOG_NDDEBUG 1
-//#define LOG_NIDEBUG 1
-#define BTSNOOPDISP_INCLUDED TRUE
-#define BTSNOOP_FILENAME "/data/misc/bluedroid/btsnoop_hci.log"
-#define SNOOP_CONFIG_PATH "/data/misc/bluedroid/btsnoop_enabled"
-#define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
-#define BTLA_REL_2_X TRUE
-#define BTAPP_DM_SUPPORTED_SERVICES (BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK | BTA_A2DP_SERVICE_MASK | BTA_HID_SERVICE_MASK | BTA_OPP_SERVICE_MASK | BTA_BPP_SERVICE_MASK)
-#define PBAP_ZERO_VCARD_IN_DB FALSE
-#define BTA_DM_SDP_DB_SIZE 4096
-#define BTA_BUSAPP_INCLUDED TRUE
-#define MAX_L2CAP_CLIENTS 15
-#define FTS_REJECT_INVALID_OBEX_SET_PATH_REQ TRUE
-#define HID_HOST_MAX_CONN_RETRY (3)
-#define BTAPP_TEST_OOB_INCLUDED TRUE
-#define ENABLE_PCM_LOGGER FALSE
-#define BTM_DISC_DURING_RS TRUE
-#define BT_UART_PORT "/dev/ttyO1"
-#define BTM_WBS_INCLUDED FALSE
-#define HL_INCLUDED FALSE
-#define NO_GKI_RUN_RETURN TRUE
-#define BTE_MAIN_CFG_DEFAULT_PATCHFILE_NAME ("/vendor/firmware/bcm4330.hcd")
-#define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
-#endif
-
diff --git a/main/Android.mk b/main/Android.mk
index eb8a880..18c89fc 100755
--- a/main/Android.mk
+++ b/main/Android.mk
@@ -1,5 +1,7 @@
LOCAL_PATH:= $(call my-dir)
+include $(LOCAL_PATH)/../include/buildcfg.mk
+
#
# Bluetooth HW module
#
@@ -15,7 +17,8 @@ LOCAL_SRC_FILES+= \
bte_main.c \
bte_init.c \
bte_version.c \
- bte_logmsg.c
+ bte_logmsg.c \
+ bte_conf.c
# BTIF
LOCAL_SRC_FILES += \
@@ -105,7 +108,7 @@ LOCAL_STATIC_LIBRARIES := libbt-brcm_gki libbt-brcm_bta libbt-brcm_stack
LOCAL_MODULE := bluetooth.default
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
diff --git a/main/bte_conf.c b/main/bte_conf.c
new file mode 100644
index 0000000..a24a138
--- /dev/null
+++ b/main/bte_conf.c
@@ -0,0 +1,221 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2009-2012 Broadcom Corporation
+ *
+ * This program is the proprietary software of Broadcom Corporation and/or its
+ * licensors, and may only be used, duplicated, modified or distributed
+ * pursuant to the terms and conditions of a separate, written license
+ * agreement executed between you and Broadcom (an "Authorized License").
+ * Except as set forth in an Authorized License, Broadcom grants no license
+ * (express or implied), right to use, or waiver of any kind with respect to
+ * the Software, and Broadcom expressly reserves all rights in and to the
+ * Software and all intellectual property rights therein.
+ * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
+ * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
+ * ALL USE OF THE SOFTWARE.
+ *
+ * Except as expressly set forth in the Authorized License,
+ *
+ * 1. This program, including its structure, sequence and organization,
+ * constitutes the valuable trade secrets of Broadcom, and you shall
+ * use all reasonable efforts to protect the confidentiality thereof,
+ * and to use this information only in connection with your use of
+ * Broadcom integrated circuit products.
+ *
+ * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
+ * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
+ * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
+ * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
+ * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
+ * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
+ * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT
+ * OF USE OR PERFORMANCE OF THE SOFTWARE.
+ *
+ * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR
+ * ITS LICENSORS BE LIABLE FOR
+ * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
+ * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
+ * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
+ * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
+ * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
+ * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
+ * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * Filename: bte_conf.c
+ *
+ * Description: Contains functions to conduct run-time module configuration
+ * based on entries present in the .conf file
+ *
+ ******************************************************************************/
+
+#define LOG_TAG "bte_conf"
+
+#include <utils/Log.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "bt_target.h"
+
+/******************************************************************************
+** Externs
+******************************************************************************/
+extern BOOLEAN trace_conf_enabled;
+void bte_trace_conf(char *p_name, char *p_conf_value);
+int device_name_cfg(char *p_conf_name, char *p_conf_value);
+int device_class_cfg(char *p_conf_name, char *p_conf_value);
+int trace_cfg_onoff(char *p_conf_name, char *p_conf_value);
+
+BD_NAME local_device_default_name = BTM_DEF_LOCAL_NAME;
+DEV_CLASS local_device_default_class = {0x40, 0x02, 0x0C};
+
+/******************************************************************************
+** Local type definitions
+******************************************************************************/
+
+#define CONF_COMMENT '#'
+#define CONF_DELIMITERS " =\n\r\t"
+#define CONF_VALUES_DELIMITERS "\"=\n\r\t"
+#define CONF_COD_DELIMITERS " {,}\t"
+#define CONF_MAX_LINE_LEN 255
+
+typedef int (conf_action_t)(char *p_conf_name, char *p_conf_value);
+
+typedef struct {
+ const char *conf_entry;
+ conf_action_t *p_action;
+} conf_entry_t;
+
+/******************************************************************************
+** Static variables
+******************************************************************************/
+
+/*
+ * Current supported entries and corresponding action functions
+ */
+/* TODO: Name and Class are duplicated with NVRAM adapter_info. Need to be sorted out */
+static const conf_entry_t conf_table[] = {
+ /*{"Name", device_name_cfg},
+ {"Class", device_class_cfg},*/
+ {"TraceConf", trace_cfg_onoff},
+ {(const char *) NULL, NULL}
+};
+
+/*****************************************************************************
+** FUNCTIONS
+*****************************************************************************/
+
+int device_name_cfg(char *p_conf_name, char *p_conf_value)
+{
+ strcpy((char *)local_device_default_name, p_conf_value);
+ return 0;
+}
+
+int device_class_cfg(char *p_conf_name, char *p_conf_value)
+{
+ char *p_token;
+ unsigned int x;
+
+ p_token = strtok(p_conf_value, CONF_COD_DELIMITERS);
+ sscanf(p_token, "%x", &x);
+ local_device_default_class[0] = (UINT8) x;
+ p_token = strtok(NULL, CONF_COD_DELIMITERS);
+ sscanf(p_token, "%x", &x);
+ local_device_default_class[1] = (UINT8) x;
+ p_token = strtok(NULL, CONF_COD_DELIMITERS);
+ sscanf(p_token, "%x", &x);
+ local_device_default_class[2] = (UINT8) x;
+
+ return 0;
+}
+
+int trace_cfg_onoff(char *p_conf_name, char *p_conf_value)
+{
+ trace_conf_enabled = (strcmp(p_conf_value, "true") == 0) ? TRUE : FALSE;
+ return 0;
+}
+
+/*****************************************************************************
+** CONF INTERFACE FUNCTIONS
+*****************************************************************************/
+
+/*******************************************************************************
+**
+** Function bte_load_conf
+**
+** Description Read conf entry from p_path file one by one and call
+** the corresponding config function
+**
+** Returns None
+**
+*******************************************************************************/
+void bte_load_conf(const char *p_path)
+{
+ FILE *p_file;
+ char *p_name;
+ char *p_value;
+ conf_entry_t *p_entry;
+ char line[CONF_MAX_LINE_LEN+1]; /* add 1 for \0 char */
+ BOOLEAN name_matched;
+
+ LOGI("Attempt to load stack conf from %s", p_path);
+
+ if ((p_file = fopen(p_path, "r")) != NULL)
+ {
+ /* read line by line */
+ while (fgets(line, CONF_MAX_LINE_LEN+1, p_file) != NULL)
+ {
+ if (line[0] == CONF_COMMENT)
+ continue;
+
+ p_name = strtok(line, CONF_DELIMITERS);
+
+ if (NULL == p_name)
+ {
+ continue;
+ }
+
+ p_value = strtok(NULL, CONF_VALUES_DELIMITERS);
+
+ if (NULL == p_value)
+ {
+ LOGW("bte_load_conf: missing value for name: %s", p_name);
+ continue;
+ }
+
+ name_matched = FALSE;
+ p_entry = (conf_entry_t *)conf_table;
+
+ while (p_entry->conf_entry != NULL)
+ {
+ if (strcmp(p_entry->conf_entry, (const char *)p_name) == 0)
+ {
+ name_matched = TRUE;
+ if (p_entry->p_action != NULL)
+ p_entry->p_action(p_name, p_value);
+ break;
+ }
+
+ p_entry++;
+ }
+
+ if ((name_matched == FALSE) && (trace_conf_enabled == TRUE))
+ {
+ /* Check if this is a TRC config item */
+ bte_trace_conf(p_name, p_value);
+ }
+ }
+
+ fclose(p_file);
+ }
+ else
+ {
+ LOGI( "bte_load_conf file >%s< not found", p_path);
+ }
+}
+
diff --git a/main/bte_logmsg.c b/main/bte_logmsg.c
index 471728e..d8121a2 100644
--- a/main/bte_logmsg.c
+++ b/main/bte_logmsg.c
@@ -1,15 +1,16 @@
/*****************************************************************************
-**
-** Name: bte_logmsg.c
-**
+**
+** Name: bte_logmsg.c
+**
** Description: Contains the LogMsg wrapper routines for BTE. It routes calls
** the appropriate application's LogMsg equivalent.
-**
-** Copyright (c) 2001-2011, WIDCOMM Inc., All Rights Reserved.
-** WIDCOMM Bluetooth Core. Proprietary and confidential.
+**
+** Copyright (c) 2001-2011, WIDCOMM Inc., All Rights Reserved.
+** WIDCOMM Bluetooth Core. Proprietary and confidential.
******************************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
@@ -91,8 +92,8 @@
#include <sys/time.h>
#include <time.h>
-#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
-#define LOG_TAG "BTLD"
+#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
+#define LOG_TAG "BtLogMsg"
#ifndef LINUX_NATIVE
#include <cutils/log.h>
@@ -110,7 +111,9 @@
//#include "btl_cfg.h"
#define BTL_GLOBAL_PROP_TRC_FLAG "TRC_BTAPP"
-
+#ifndef DEFAULT_CONF_TRACE_LEVEL
+#define DEFAULT_CONF_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
+#endif
#ifndef BTE_LOG_BUF_SIZE
#define BTE_LOG_BUF_SIZE 1024
@@ -169,7 +172,7 @@ LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...)
vsnprintf(&buffer[MSG_BUFFER_OFFSET], BTE_LOG_MAX_SIZE, fmt_str, ap);
va_end(ap);
-#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
+#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
#if (BTE_MAP_TRACE_LEVEL==TRUE)
switch ( TRACE_GET_TYPE(trace_set_mask) )
{
@@ -196,7 +199,7 @@ LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...)
#else
write(2, buffer, strlen(buffer));
write(2, "\n", 1);
-#endif
+#endif
}
void
@@ -221,12 +224,12 @@ ScrLog(UINT32 trace_set_mask, const char *fmt_str, ...)
vsnprintf(&buffer[strlen(buffer)], BTE_LOG_MAX_SIZE, fmt_str, ap);
va_end(ap);
-#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
+#if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
LOGI0(buffer);
#else
write(2, buffer, strlen(buffer));
write(2, "\n", 1);
-#endif
+#endif
}
/* this function should go into BTAPP_DM for example */
@@ -246,8 +249,22 @@ BTU_API UINT8 BTU_SetTraceLevel( UINT8 new_level )
return (btu_cb.trace_level);
}
+BOOLEAN trace_conf_enabled = FALSE;
+void bte_trace_conf(char *p_conf_name, char *p_conf_value)
+{
+ tBTTRC_FUNC_MAP *p_f_map = (tBTTRC_FUNC_MAP *) &bttrc_set_level_map[0];
+ while (p_f_map->trc_name != NULL)
+ {
+ if (strcmp(p_f_map->trc_name, (const char *)p_conf_name) == 0)
+ {
+ p_f_map->trace_level = (UINT8) atoi(p_conf_value);
+ break;
+ }
+ p_f_map++;
+ }
+}
/********************************************************************************
**
@@ -317,99 +334,74 @@ BT_API tBTTRC_LEVEL * BTA_SysSetTraceLevel(tBTTRC_LEVEL * p_levels)
} /* BTA_SysSetTraceLevel() */
/* make sure list is order by increasing layer id!!! */
-const tBTTRC_FUNC_MAP bttrc_set_level_map[] = {
- { BTTRC_ID_STK_BTU, BTTRC_ID_STK_HCI, (const tBTTRC_SET_TRACE_LEVEL *)BTU_SetTraceLevel, "TRC_HCI" },
- { BTTRC_ID_STK_L2CAP, BTTRC_ID_STK_L2CAP, (const tBTTRC_SET_TRACE_LEVEL *)L2CA_SetTraceLevel, "TRC_L2CAP" },
+tBTTRC_FUNC_MAP bttrc_set_level_map[] = {
+ {BTTRC_ID_STK_BTU, BTTRC_ID_STK_HCI, BTU_SetTraceLevel, "TRC_HCI", DEFAULT_CONF_TRACE_LEVEL},
+ {BTTRC_ID_STK_L2CAP, BTTRC_ID_STK_L2CAP, L2CA_SetTraceLevel, "TRC_L2CAP", DEFAULT_CONF_TRACE_LEVEL},
#if (RFCOMM_INCLUDED==TRUE)
- { BTTRC_ID_STK_RFCOMM, BTTRC_ID_STK_RFCOMM_DATA, (const tBTTRC_SET_TRACE_LEVEL *)PORT_SetTraceLevel, "TRC_RFCOMM" },
+ {BTTRC_ID_STK_RFCOMM, BTTRC_ID_STK_RFCOMM_DATA, PORT_SetTraceLevel, "TRC_RFCOMM", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (OBX_INCLUDED==TRUE)
- { BTTRC_ID_STK_OBEX, BTTRC_ID_STK_OBEX, (const tBTTRC_SET_TRACE_LEVEL *)OBX_SetTraceLevel, "TRC_OBEX" },
+ {BTTRC_ID_STK_OBEX, BTTRC_ID_STK_OBEX, OBX_SetTraceLevel, "TRC_OBEX", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (AVCT_INCLUDED==TRUE)
- //{ BTTRC_ID_STK_AVCT, BTTRC_ID_STK_AVCT, (tBTTRC_SET_TRACE_LEVEL *)NULL, "TRC_AVCT" },
+ //{BTTRC_ID_STK_AVCT, BTTRC_ID_STK_AVCT, NULL, "TRC_AVCT", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (AVDT_INCLUDED==TRUE)
- { BTTRC_ID_STK_AVDT, BTTRC_ID_STK_AVDT, (const tBTTRC_SET_TRACE_LEVEL *)AVDT_SetTraceLevel, "TRC_AVDT" },
+ {BTTRC_ID_STK_AVDT, BTTRC_ID_STK_AVDT, AVDT_SetTraceLevel, "TRC_AVDT", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (AVRC_INCLUDED==TRUE)
- { BTTRC_ID_STK_AVRC, BTTRC_ID_STK_AVRC, (const tBTTRC_SET_TRACE_LEVEL *)AVRC_SetTraceLevel, "TRC_AVRC" },
+ {BTTRC_ID_STK_AVRC, BTTRC_ID_STK_AVRC, AVRC_SetTraceLevel, "TRC_AVRC", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (AVDT_INCLUDED==TRUE)
- //{ BTTRC_ID_AVDT_SCB, BTTRC_ID_AVDT_CCB, (tBTTRC_SET_TRACE_LEVEL *)NULL, "TRC_AVDT_SCB" },
+ //{BTTRC_ID_AVDT_SCB, BTTRC_ID_AVDT_CCB, NULL, "TRC_AVDT_SCB", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (A2D_INCLUDED==TRUE)
- { BTTRC_ID_STK_A2D, BTTRC_ID_STK_A2D, (const tBTTRC_SET_TRACE_LEVEL *)A2D_SetTraceLevel, "TRC_A2D" },
+ {BTTRC_ID_STK_A2D, BTTRC_ID_STK_A2D, A2D_SetTraceLevel, "TRC_A2D", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (BIP_INCLUDED==TRUE)
- { BTTRC_ID_STK_BIP, BTTRC_ID_STK_BIP, (const tBTTRC_SET_TRACE_LEVEL *)BIP_SetTraceLevel, "TRC_BIP" },
+ {BTTRC_ID_STK_BIP, BTTRC_ID_STK_BIP, BIP_SetTraceLevel, "TRC_BIP", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (BNEP_INCLUDED==TRUE)
- { BTTRC_ID_STK_BNEP, BTTRC_ID_STK_BNEP, (const tBTTRC_SET_TRACE_LEVEL *)BNEP_SetTraceLevel, "TRC_BNEP" },
+ {BTTRC_ID_STK_BNEP, BTTRC_ID_STK_BNEP, BNEP_SetTraceLevel, "TRC_BNEP", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (BPP_INCLUDED==TRUE)
- { BTTRC_ID_STK_BPP, BTTRC_ID_STK_BPP, (const tBTTRC_SET_TRACE_LEVEL *)BPP_SetTraceLevel, "TRC_BPP" },
+ {BTTRC_ID_STK_BPP, BTTRC_ID_STK_BPP, BPP_SetTraceLevel, "TRC_BPP", DEFAULT_CONF_TRACE_LEVEL},
#endif
- { BTTRC_ID_STK_BTM_ACL, BTTRC_ID_STK_BTM_SEC, (const tBTTRC_SET_TRACE_LEVEL *)BTM_SetTraceLevel, "TRC_BTM" },
+ {BTTRC_ID_STK_BTM_ACL, BTTRC_ID_STK_BTM_SEC, BTM_SetTraceLevel, "TRC_BTM", DEFAULT_CONF_TRACE_LEVEL},
#if (DUN_INCLUDED==TRUE)
- { BTTRC_ID_STK_DUN, BTTRC_ID_STK_DUN, (const tBTTRC_SET_TRACE_LEVEL *)DUN_SetTraceLevel, "TRC_DUN" },
+ {BTTRC_ID_STK_DUN, BTTRC_ID_STK_DUN, DUN_SetTraceLevel, "TRC_DUN", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (GAP_INCLUDED==TRUE)
- { BTTRC_ID_STK_GAP, BTTRC_ID_STK_GAP, (const tBTTRC_SET_TRACE_LEVEL *)GAP_SetTraceLevel, "TRC_GAP" },
+ {BTTRC_ID_STK_GAP, BTTRC_ID_STK_GAP, GAP_SetTraceLevel, "TRC_GAP", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (GOEP_INCLUDED==TRUE)
- { BTTRC_ID_STK_GOEP, BTTRC_ID_STK_GOEP, (const tBTTRC_SET_TRACE_LEVEL *)GOEP_SetTraceLevel, "TRC_GOEP" },
+ {BTTRC_ID_STK_GOEP, BTTRC_ID_STK_GOEP, GOEP_SetTraceLevel, "TRC_GOEP", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (HCRP_INCLUDED==TRUE)
- { BTTRC_ID_STK_HCRP, BTTRC_ID_STK_HCRP, (const tBTTRC_SET_TRACE_LEVEL *)HCRP_SetTraceLevel, "TRC_HCRP" },
+ {BTTRC_ID_STK_HCRP, BTTRC_ID_STK_HCRP, HCRP_SetTraceLevel, "TRC_HCRP", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (PAN_INCLUDED==TRUE)
- { BTTRC_ID_STK_PAN, BTTRC_ID_STK_PAN, (const tBTTRC_SET_TRACE_LEVEL *)PAN_SetTraceLevel, "TRC_PAN" },
+ {BTTRC_ID_STK_PAN, BTTRC_ID_STK_PAN, PAN_SetTraceLevel, "TRC_PAN", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (SAP_SERVER_INCLUDED==TRUE)
- { BTTRC_ID_STK_SAP, BTTRC_ID_STK_SAP, (tBTTRC_SET_TRACE_LEVEL *)NULL, "TRC_SAP" },
+ {BTTRC_ID_STK_SAP, BTTRC_ID_STK_SAP, NULL, "TRC_SAP", DEFAULT_CONF_TRACE_LEVEL},
#endif
- { BTTRC_ID_STK_SDP, BTTRC_ID_STK_SDP, (const tBTTRC_SET_TRACE_LEVEL *)SDP_SetTraceLevel, "TRC_SDP" },
+ {BTTRC_ID_STK_SDP, BTTRC_ID_STK_SDP, SDP_SetTraceLevel, "TRC_SDP", DEFAULT_CONF_TRACE_LEVEL},
#if (BLE_INCLUDED==TRUE)
- { BTTRC_ID_STK_GATT, BTTRC_ID_STK_GATT, (const tBTTRC_SET_TRACE_LEVEL *)GATT_SetTraceLevel , "TRC_GATT" },
+ {BTTRC_ID_STK_GATT, BTTRC_ID_STK_GATT, GATT_SetTraceLevel, "TRC_GATT", DEFAULT_CONF_TRACE_LEVEL},
#endif
#if (BLE_INCLUDED==TRUE)
- { BTTRC_ID_STK_SMP, BTTRC_ID_STK_SMP, (const tBTTRC_SET_TRACE_LEVEL *)SMP_SetTraceLevel , "TRC_SMP" },
+ {BTTRC_ID_STK_SMP, BTTRC_ID_STK_SMP, SMP_SetTraceLevel, "TRC_SMP", DEFAULT_CONF_TRACE_LEVEL},
#endif
- /* LayerIDs for BTA, currently everything maps onto appl_trace_level. BTL_GLOBAL_PROP_TRC_FLAG
- * serves as flag in property. if present, the whole table is scanned. */
#if (BTA_INCLUDED==TRUE)
- { BTTRC_ID_BTA_ACC, BTTRC_ID_BTAPP, (const tBTTRC_SET_TRACE_LEVEL *)BTAPP_SetTraceLevel, BTL_GLOBAL_PROP_TRC_FLAG },
-#endif
-
-#if 0
- {BTTRC_ID_BTA_HF 39 /* headset/handsfree AG & HF */
- {BTTRC_ID_BTA_AV 40 /* Advanced audio */
- {BTTRC_ID_BTA_BIP 41 /* Basic Imaging Client */
- {BTTRC_ID_BTA_BP 42 /* Basic Printing Client */
- {BTTRC_ID_BTA_CTP 43 /* cordless telephony profile */
- {BTTRC_ID_BTA_DG 44 /* data gateway */
- {BTTRC_ID_BTA_DM 45 /* device manager */
- {BTTRC_ID_BTA_FM 46
- {BTTRC_ID_BTA_FS 47 /* File System */
- {BTTRC_ID_BTA_FTP 48 /* file transfer client & server */
- {BTTRC_ID_BTA_HID 49 /* hidc & hidd */
- {BTTRC_ID_BTA_JV 50 /* java connector */
- {BTTRC_ID_BTA_OPP 51 /* object push client */
- {BTTRC_ID_BTA_PAN 52 /* Personal Area Networking */
- {BTTRC_ID_BTA_PR 53 /* Printer module */
- {BTTRC_ID_BTA_SC 54 /* SIM Card Access module */
- {BTTRC_ID_BTA_SS 55 /* synchronization module */
- {BTTRC_ID_BTA_SYS 56 /* system manager */
- {BTTRC_ID_BTA_SSR 57 /* GPS sensor */
- {BTTRC_ID_BTA_ME 58 /* message equipement server/client */
-
- /* LayerIDs for BT APP */
- { BTTRC_ID_BTAPP, BTTRC_ID_BTAPP, (const tBTTRC_SET_TRACE_LEVEL *)BTAPP_SetTraceLevel, "BTAPP" },
-#endif
-
- { 0, 0, NULL, "" }
+ /* LayerIDs for BTA, currently everything maps onto appl_trace_level.
+ * BTL_GLOBAL_PROP_TRC_FLAG serves as flag in conf.
+ */
+ {BTTRC_ID_BTA_ACC, BTTRC_ID_BTAPP, BTAPP_SetTraceLevel, BTL_GLOBAL_PROP_TRC_FLAG, DEFAULT_CONF_TRACE_LEVEL},
+#endif
+
+ {0, 0, NULL, NULL, DEFAULT_CONF_TRACE_LEVEL}
};
const UINT16 bttrc_map_size = sizeof(bttrc_set_level_map)/sizeof(tBTTRC_FUNC_MAP);
@@ -431,35 +423,26 @@ const UINT16 bttrc_map_size = sizeof(bttrc_set_level_map)/sizeof(tBTTRC_FUNC_MAP
*********************************************************************************/
BT_API void BTE_InitTraceLevels( void )
{
- /* read and set trace levels from android property system and call the different
- * XXX_SetTraceLevel().
+ /* read and set trace levels by calling the different XXX_SetTraceLevel().
*/
#if ( BT_USE_TRACES==TRUE )
- /* read runtime trace settings after init of control block */
-
- // BLUEDROID MOD
- //if ( !btl_cfg_get_trace_prop() )
+ if (trace_conf_enabled == TRUE)
{
-#if defined(BTL_CFG_USE_CONF_FILE) && (BTL_CFG_USE_CONF_FILE==TRUE)
- if (NULL!=bte_appl_cfg.p_conf_params)
- {
- if ( 0 > btl_cfg_set_by_idx_conf( &conf_table, bte_appl_cfg.p_conf_params,
- BTL_CFG_CONF_TRACE) )
- {
- BT_TRACE_0( TRACE_LAYER_NONE, TRACE_TYPE_DEBUG, "[bttrc] using compile default trace settings" );
- }
- /* free up property settings data from conf file as needed anymore */
- GKI_os_free(bte_appl_cfg.p_conf_params);
- bte_appl_cfg.p_conf_params = NULL;
- BT_TRACE_0( TRACE_LAYER_NONE, TRACE_TYPE_DEBUG, "BTE_InitTraceLevels(): freed p_conf_params" );
- }
- else
+ tBTTRC_FUNC_MAP *p_f_map = (tBTTRC_FUNC_MAP *) &bttrc_set_level_map[0];
+
+ while (p_f_map->trc_name != NULL)
{
- BT_TRACE_0( TRACE_LAYER_NONE, TRACE_TYPE_DEBUG, "[bttrc] using compile default trace settings" );
+ LOGI("BTE_InitTraceLevels -- %s", p_f_map->trc_name);
+
+ if (p_f_map->p_f)
+ p_f_map->p_f(p_f_map->trace_level);
+
+ p_f_map++;
}
-#else
- BT_TRACE_0( TRACE_LAYER_NONE, TRACE_TYPE_DEBUG, "[bttrc] using compile default trace settings" );
-#endif
+ }
+ else
+ {
+ LOGI("[bttrc] using compile default trace settings");
}
#endif
}
diff --git a/main/bte_main.c b/main/bte_main.c
index 274ee7d..7707d48 100644
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -66,6 +66,11 @@
** Constants & Macros
*******************************************************************************/
+/* Run-time configuration file */
+#ifndef BTE_STACK_CONF_FILE
+#define BTE_STACK_CONF_FILE "/etc/bluetooth/bt_stack.conf"
+#endif
+
/*******************************************************************************
** Local type definitions
*******************************************************************************/
@@ -94,6 +99,7 @@ extern void btsnoop_init(void);
extern void btsnoop_open(void);
extern void btsnoop_close(void);
extern void btsnoop_cleanup (void);
+extern void bte_load_conf(const char *p_path);
@@ -142,6 +148,8 @@ void bte_main_boot_entry(void)
bte_main_in_hw_init();
+ bte_load_conf(BTE_STACK_CONF_FILE);
+
#if (BTTRC_INCLUDED == TRUE)
/* Initialize trace feature */
BTTRC_TraceInit(MAX_TRACE_RAM_SIZE, &BTE_TraceLogBuf[0], BTTRC_METHOD_RAM);
diff --git a/stack/Android.mk b/stack/Android.mk
index 34c191c..f280b5d 100644
--- a/stack/Android.mk
+++ b/stack/Android.mk
@@ -2,6 +2,8 @@ ifneq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)
+include $(LOCAL_PATH)/../include/buildcfg.mk
+
include $(CLEAR_VARS)
LOCAL_C_INCLUDES:= . \
@@ -181,7 +183,7 @@ LOCAL_SRC_FILES:= \
./goep/goep_util.c
LOCAL_MODULE := libbt-brcm_stack
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libc
include $(BUILD_STATIC_LIBRARY)
diff --git a/vendor/libvendor/Android.mk b/vendor/libvendor/Android.mk
index 8ea5e90..808990d 100644
--- a/vendor/libvendor/Android.mk
+++ b/vendor/libvendor/Android.mk
@@ -2,6 +2,19 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+vnd_targetfile = $(LOCAL_PATH)/include/$(addprefix vnd_, $(addsuffix .txt,$(basename $(TARGET_DEVICE))))
+vnd_cfgfile = $(LOCAL_PATH)/include/vnd_buildcfg.h
+
+vnd_build_cfg = $(shell if [ -f $(vnd_cfgfile) ] && [ `stat -c %Y $(vnd_targetfile)` -lt `stat -c %Y $(vnd_cfgfile)` ]; then echo 0; else echo 1; fi)
+
+ifeq ($(vnd_build_cfg),1)
+$(info "Creating $(vnd_cfgfile) from $(vnd_targetfile)")
+$(shell echo "#ifndef VND_BUILDCFG_H" > $(vnd_cfgfile))
+$(shell echo "#define VND_BUILDCFG_H" >> $(vnd_cfgfile))
+$(shell sed -e '/^#/d' -e '/^$$/d' -e '/# Makefile only$$/d' -e 's/^/#define /' -e 's/=/ /' $(vnd_targetfile) >> $(vnd_cfgfile))
+$(shell echo "#endif" >> $(vnd_cfgfile))
+endif
+
LOCAL_SRC_FILES := \
src/bt_vendor_brcm.c \
src/hci_h4.c \
@@ -9,7 +22,8 @@ LOCAL_SRC_FILES := \
src/hardware.c \
src/upio.c \
src/utils.c \
- src/btsnoop.c
+ src/btsnoop.c \
+ src/conf.c
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/include
diff --git a/vendor/libvendor/include/bt_vendor_brcm.h b/vendor/libvendor/include/bt_vendor_brcm.h
index 326a8da..ae72fc7 100644
--- a/vendor/libvendor/include/bt_vendor_brcm.h
+++ b/vendor/libvendor/include/bt_vendor_brcm.h
@@ -121,6 +121,11 @@
/* Local Bluetooth Controller ID for BR/EDR */
#define LOCAL_BR_EDR_CONTROLLER_ID 0
+/* Run-time configuration file */
+#ifndef VENDOR_LIB_CONF_FILE
+#define VENDOR_LIB_CONF_FILE "/etc/bluetooth/bt_vendor.conf"
+#endif
+
/* Device port name where Bluetooth controller attached */
#ifndef BLUETOOTH_UART_DEVICE_PORT
#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyO1" /* maguro */
@@ -128,7 +133,7 @@
/* Location of firmware patch files */
#ifndef FW_PATCHFILE_LOCATION
-#define FW_PATCHFILE_LOCATION ("/vendor/firmware/") /* maguro */
+#define FW_PATCHFILE_LOCATION "/vendor/firmware/" /* maguro */
#endif
#ifndef UART_TARGET_BAUD_RATE
@@ -385,6 +390,21 @@
#define FACTORY_BT_BDADDR_STORAGE_LEN 17
+/* Debug mode with bit-wise mask */
+typedef uint8_t vnd_debug_t;
+#define DEBUG_ON 0xFF
+#define DEBUG_OFF 0x00
+
+/* Define trace On/Off bit for every modules */
+enum {
+ TRACE_VND,
+ TRACE_HW,
+ TRACE_USERIAL,
+ TRACE_HCI,
+ TRACE_UPIO,
+ TRACE_BTSNOOP
+};
+
/******************************************************************************
** Type definitions and return values
******************************************************************************/
@@ -416,6 +436,8 @@ typedef struct _vnd_buffer_hdr
******************************************************************************/
extern bt_vendor_callbacks_t *bt_vendor_cbacks;
+extern vnd_debug_t dbg_mode;
+extern vnd_debug_t traces;
/******************************************************************************
** Functions
diff --git a/vendor/libvendor/include/userial.h b/vendor/libvendor/include/userial.h
index 9231bb0..818bb8f 100644
--- a/vendor/libvendor/include/userial.h
+++ b/vendor/libvendor/include/userial.h
@@ -241,5 +241,17 @@ void userial_change_baud(uint8_t baud);
*******************************************************************************/
void userial_ioctl(userial_ioctl_op_t op, void *p_data);
+/*******************************************************************************
+**
+** Function userial_set_port
+**
+** Description Configure UART port name
+**
+** Returns 0 : Success
+** Otherwise : Fail
+**
+*******************************************************************************/
+int userial_set_port(char *p_conf_name, char *p_conf_value, int param);
+
#endif /* USERIAL_H */
diff --git a/vendor/libvendor/include/vnd_buildcfg.h b/vendor/libvendor/include/vnd_buildcfg.h
deleted file mode 100644
index a6fbb23..0000000
--- a/vendor/libvendor/include/vnd_buildcfg.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef VND_BUILDCFG_H
-#define VND_BUILDCFG_H
-//#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyHS0" /* pyramid */
-//#define FW_PATCHFILE_LOCATION ("/etc/firmware/") /* pyramid */
-//#define LPM_BT_WAKE_POLARITY 0 /* pyramid */
-//#define LPM_HOST_WAKE_POLARITY 0 /* pyramid */
-#define BT_WAKE_VIA_USERIAL_IOCTL TRUE
-#define LPM_IDLE_TIMEOUT_MULTIPLE 5
-#define BTSNOOPDISP_INCLUDED TRUE
-#define BTSNOOP_FILENAME "/data/misc/bluedroid/btsnoop_hci.cfa"
-#define SNOOP_CONFIG_PATH "/data/misc/bluedroid/btsnoop_enabled"
-#define BTSNOOP_DBG FALSE
-#define SCO_USE_I2S_INTERFACE TRUE
-#endif // VND_BUILDCFG_H
diff --git a/vendor/libvendor/include/vnd_crespo.txt b/vendor/libvendor/include/vnd_crespo.txt
new file mode 100644
index 0000000..9296738
--- /dev/null
+++ b/vendor/libvendor/include/vnd_crespo.txt
@@ -0,0 +1,11 @@
+BLUETOOTH_UART_DEVICE_PORT = "/dev/s3c2410_serial0"
+BT_WAKE_VIA_USERIAL_IOCTL = TRUE
+LPM_IDLE_TIMEOUT_MULTIPLE = 5
+BTSNOOPDISP_INCLUDED = TRUE
+BTSNOOP_FILENAME = "/data/misc/bluedroid/btsnoop_hci.log"
+BTVND_DBG = TRUE
+BTHW_DBG = TRUE
+USERIAL_DBG = TRUE
+HCIH4_DBG = TRUE
+UPIO_DBG = TRUE
+BTSNOOP_DBG = FALSE
diff --git a/vendor/libvendor/include/vnd_maguro.txt b/vendor/libvendor/include/vnd_maguro.txt
new file mode 100644
index 0000000..8705da6
--- /dev/null
+++ b/vendor/libvendor/include/vnd_maguro.txt
@@ -0,0 +1,11 @@
+BT_WAKE_VIA_USERIAL_IOCTL = TRUE
+LPM_IDLE_TIMEOUT_MULTIPLE = 5
+BTSNOOPDISP_INCLUDED = TRUE
+BTSNOOP_FILENAME = "/data/misc/bluedroid/btsnoop_hci.log"
+SCO_USE_I2S_INTERFACE = TRUE
+BTVND_DBG = TRUE
+BTHW_DBG = TRUE
+USERIAL_DBG = FALSE
+HCIH4_DBG = FALSE
+UPIO_DBG = FALSE
+BTSNOOP_DBG = FALSE
diff --git a/vendor/libvendor/include/vnd_toro.txt b/vendor/libvendor/include/vnd_toro.txt
new file mode 100644
index 0000000..8705da6
--- /dev/null
+++ b/vendor/libvendor/include/vnd_toro.txt
@@ -0,0 +1,11 @@
+BT_WAKE_VIA_USERIAL_IOCTL = TRUE
+LPM_IDLE_TIMEOUT_MULTIPLE = 5
+BTSNOOPDISP_INCLUDED = TRUE
+BTSNOOP_FILENAME = "/data/misc/bluedroid/btsnoop_hci.log"
+SCO_USE_I2S_INTERFACE = TRUE
+BTVND_DBG = TRUE
+BTHW_DBG = TRUE
+USERIAL_DBG = FALSE
+HCIH4_DBG = FALSE
+UPIO_DBG = FALSE
+BTSNOOP_DBG = FALSE
diff --git a/vendor/libvendor/include/vnd_wingray.txt b/vendor/libvendor/include/vnd_wingray.txt
new file mode 100644
index 0000000..57ac1c3
--- /dev/null
+++ b/vendor/libvendor/include/vnd_wingray.txt
@@ -0,0 +1,12 @@
+BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyHS2"
+FW_PATCHFILE_LOCATION = "/etc/firmware/"
+BT_WAKE_VIA_USERIAL_IOCTL = TRUE
+LPM_IDLE_TIMEOUT_MULTIPLE = 5
+BTSNOOPDISP_INCLUDED = TRUE
+BTSNOOP_FILENAME = "/data/misc/bluedroid/btsnoop_hci.log"
+BTVND_DBG = TRUE
+BTHW_DBG = TRUE
+USERIAL_DBG = TRUE
+HCIH4_DBG = TRUE
+UPIO_DBG = TRUE
+BTSNOOP_DBG = FALSE
diff --git a/vendor/libvendor/src/bt_vendor_brcm.c b/vendor/libvendor/src/bt_vendor_brcm.c
index 0b10876..9b25692 100644
--- a/vendor/libvendor/src/bt_vendor_brcm.c
+++ b/vendor/libvendor/src/bt_vendor_brcm.c
@@ -67,9 +67,11 @@
#endif
#if (BTVND_DBG == TRUE)
-#define BTVNDDBG LOGD
+#define BTVNDDBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_VND)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define BTVNDDBG
+#define BTVNDDBG(param, ...) {}
#endif
/******************************************************************************
@@ -90,6 +92,7 @@ void hw_lpm_assert_bt_wake(void);
#if (SCO_CFG_INCLUDED == TRUE)
void hw_sco_config(void);
#endif
+void vnd_load_conf(const char *p_path);
/******************************************************************************
** Variables
@@ -98,6 +101,10 @@ void hw_sco_config(void);
bt_vendor_callbacks_t *bt_vendor_cbacks = NULL;
BUFFER_Q tx_q;
+/* By default, turn off debug mode */
+vnd_debug_t dbg_mode = 0;
+vnd_debug_t traces = 0;
+
/******************************************************************************
** Local type definitions
******************************************************************************/
@@ -151,7 +158,7 @@ static int init(const bt_vendor_callbacks_t* p_cb)
struct sched_param param;
int policy;
- BTVNDDBG("init");
+ LOGI("init");
if (p_cb == NULL)
{
@@ -159,6 +166,8 @@ static int init(const bt_vendor_callbacks_t* p_cb)
return BT_VENDOR_STATUS_FAIL;
}
+ vnd_load_conf(VENDOR_LIB_CONF_FILE);
+
/* store reference to user callbacks */
bt_vendor_cbacks = (bt_vendor_callbacks_t *) p_cb;
diff --git a/vendor/libvendor/src/btsnoop.c b/vendor/libvendor/src/btsnoop.c
index 78e9dfd..eb0c026 100644
--- a/vendor/libvendor/src/btsnoop.c
+++ b/vendor/libvendor/src/btsnoop.c
@@ -3,44 +3,44 @@
* Copyright (C) 2009-2012 Broadcom Corporation
*
* This program is the proprietary software of Broadcom Corporation and/or its
- * licensors, and may only be used, duplicated, modified or distributed
- * pursuant to the terms and conditions of a separate, written license
- * agreement executed between you and Broadcom (an "Authorized License").
- * Except as set forth in an Authorized License, Broadcom grants no license
- * (express or implied), right to use, or waiver of any kind with respect to
- * the Software, and Broadcom expressly reserves all rights in and to the
- * Software and all intellectual property rights therein.
- * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
- * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
- * ALL USE OF THE SOFTWARE.
+ * licensors, and may only be used, duplicated, modified or distributed
+ * pursuant to the terms and conditions of a separate, written license
+ * agreement executed between you and Broadcom (an "Authorized License").
+ * Except as set forth in an Authorized License, Broadcom grants no license
+ * (express or implied), right to use, or waiver of any kind with respect to
+ * the Software, and Broadcom expressly reserves all rights in and to the
+ * Software and all intellectual property rights therein.
+ * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
+ * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
+ * ALL USE OF THE SOFTWARE.
*
* Except as expressly set forth in the Authorized License,
*
- * 1. This program, including its structure, sequence and organization,
- * constitutes the valuable trade secrets of Broadcom, and you shall
- * use all reasonable efforts to protect the confidentiality thereof,
- * and to use this information only in connection with your use of
+ * 1. This program, including its structure, sequence and organization,
+ * constitutes the valuable trade secrets of Broadcom, and you shall
+ * use all reasonable efforts to protect the confidentiality thereof,
+ * and to use this information only in connection with your use of
* Broadcom integrated circuit products.
*
- * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
- * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
- * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
- * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
- * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
- * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
- * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
+ * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
+ * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
+ * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
+ * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
+ * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
+ * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
* CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT
* OF USE OR PERFORMANCE OF THE SOFTWARE.
*
* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR
- * ITS LICENSORS BE LIABLE FOR
- * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
- * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
- * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
- * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
- * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
- * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
- * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
+ * ITS LICENSORS BE LIABLE FOR
+ * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
+ * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
+ * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
+ * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
+ * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
+ * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
+ * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
*
******************************************************************************/
@@ -90,9 +90,11 @@
#endif
#if (BTSNOOP_DBG == TRUE)
-#define SNOOPDBG LOGD
+#define SNOOPDBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_BTSNOOP)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define SNOOPDBG
+#define SNOOPDBG(param, ...) {}
#endif
/* file descriptor of the BT snoop file (by default, -1 means disabled) */
@@ -100,14 +102,16 @@ int hci_btsnoop_fd = -1;
#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
+/* by default, btsnoop log is off */
+uint8_t btsnoop_log_enabled = 0;
+
/* if not specified in .txt file then use this as default */
#ifndef BTSNOOP_FILENAME
-
-//#define BTSNOOP_FILENAME "/sdcard/snoop_log.cfa"
-#error "BTSNOOP_FILENAME needs to be defined in vnd_buildcfg.h"
-
+#define BTSNOOP_FILENAME "/data/misc/bluedroid/btsnoop_hci.log"
#endif /* BTSNOOP_FILENAME */
+static char btsnoop_logfile[256] = BTSNOOP_FILENAME;
+
#endif /* BTSNOOPDISP_INCLUDED */
/* Macro to perform a multiplication of 2 unsigned 32bit values and store the result
@@ -169,8 +173,8 @@ do {
** NOTE
** The return value is 64 bit as 2 32 bit variables out_lo and * out_hi.
** A BT Snoop timestamp is the number of microseconds since 01/01/0000.
- ** The timeval structure contains the number of microseconds since EPOCH
- ** (01/01/1970) encoded as: tv.tv_sec, number of seconds since EPOCH and
+ ** The timeval structure contains the number of microseconds since EPOCH
+ ** (01/01/1970) encoded as: tv.tv_sec, number of seconds since EPOCH and
** tv_usec, number of microseconds in current second
**
** Therefore the algorithm is:
@@ -245,12 +249,12 @@ static int btsnoop_log_open(void)
#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
hci_btsnoop_fd = -1;
- SNOOPDBG("btsnoop_log_open: snoop log file = %s\n", BTSNOOP_FILENAME);
+ SNOOPDBG("btsnoop_log_open: snoop log file = %s\n", btsnoop_logfile);
/* write the BT snoop header */
- if (BTSNOOP_FILENAME != NULL)
+ if (strlen(btsnoop_logfile) != 0)
{
- hci_btsnoop_fd = open((char*)BTSNOOP_FILENAME, \
+ hci_btsnoop_fd = open(btsnoop_logfile, \
O_WRONLY|O_CREAT|O_TRUNC, \
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
if (hci_btsnoop_fd == -1)
@@ -263,9 +267,8 @@ static int btsnoop_log_open(void)
write(hci_btsnoop_fd, "btsnoop\0\0\0\0\1\0\0\x3\xea", 16);
return 1;
}
-#else
- return 2; /* Snoop not available */
#endif
+ return 2; /* Snoop not available */
}
/*******************************************************************************
@@ -312,7 +315,7 @@ void btsnoop_hci_cmd(uint8_t *p)
/* since these display functions are called from different contexts */
utils_lock();
-
+
/* store the length in both original and included fields */
value = l_to_be(p[2] + 4);
write(hci_btsnoop_fd, &value, 4);
@@ -486,7 +489,7 @@ void btsnoop_acl_data(uint8_t *p, uint8_t is_rcvd)
static pthread_t thread_id;
static int s_listen = -1;
static int ext_parser_fd = -1;
-
+
static void ext_parser_detached(void);
int ext_parser_accept(int port)
@@ -503,11 +506,11 @@ int ext_parser_accept(int port)
s_listen = socket(AF_INET, SOCK_STREAM, 0);
if (s_listen < 0)
- {
+ {
LOGE("listener not created: listen fd %d", s_listen);
return -1;
}
-
+
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
@@ -529,10 +532,10 @@ int ext_parser_accept(int port)
perror("bind");
result = listen(s_listen, 1);
-
+
if (result < 0)
perror("listen");
-
+
clilen = sizeof(struct sockaddr_in);
s = accept(s_listen, (struct sockaddr *) &cliaddr, &clilen);
@@ -557,14 +560,14 @@ static int send_ext_parser(char *p, int len)
return 0;
SNOOPDBG("write %d to snoop socket\n", len);
-
+
n = write(ext_parser_fd, p, len);
if (n<=0)
{
ext_parser_detached();
}
-
+
return n;
}
@@ -572,12 +575,12 @@ static void ext_parser_detached(void)
{
LOGD("ext parser detached");
- if (ext_parser_fd>0)
+ if (ext_parser_fd>0)
close(ext_parser_fd);
-
- if (s_listen > 0)
+
+ if (s_listen > 0)
close(s_listen);
-
+
ext_parser_fd = -1;
s_listen = -1;
}
@@ -611,7 +614,7 @@ static void ext_parser_thread(void* param)
fd = ext_parser_accept(EXT_PARSER_PORT);
ext_parser_fd = fd;
-
+
LOGD("ext parser attached on fd %d\n", ext_parser_fd);
} while (1);
}
@@ -622,6 +625,25 @@ void btsnoop_stop_listener(void)
ext_parser_detached();
}
+int btsnoop_set_logfile(char *p_conf_name, char *p_conf_value, int param)
+{
+#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
+ strcpy(btsnoop_logfile, p_conf_value);
+#endif
+ return 0;
+}
+
+int btsnoop_enable_logging(char *p_conf_name, char *p_conf_value, int param)
+{
+#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
+ if (strcmp(p_conf_value, "true") == 0)
+ btsnoop_log_enabled = 1;
+ else
+ btsnoop_log_enabled = 0;
+#endif // BTSNOOPDISP_INCLUDED
+ return 0;
+}
+
void btsnoop_init(void)
{
LOGD("btsnoop_init");
@@ -634,14 +656,21 @@ void btsnoop_init(void)
void btsnoop_open(void)
{
- LOGD("btsnoop_open");
- btsnoop_log_open();
+#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
+ if (btsnoop_log_enabled)
+ {
+ LOGD("btsnoop_open");
+ btsnoop_log_open();
+ }
+#endif // BTSNOOPDISP_INCLUDED
}
void btsnoop_close(void)
{
+#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
LOGD("btsnoop_close");
btsnoop_log_close();
+#endif
}
void btsnoop_cleanup (void)
@@ -695,6 +724,7 @@ void btsnoop_capture(VND_BT_HDR *p_buf, uint8_t is_rcvd)
return;
}
+#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
if (hci_btsnoop_fd == -1)
return;
@@ -719,6 +749,7 @@ void btsnoop_capture(VND_BT_HDR *p_buf, uint8_t is_rcvd)
btsnoop_hci_cmd(p);
break;
}
+#endif // BTSNOOPDISP_INCLUDED
}
diff --git a/vendor/libvendor/src/conf.c b/vendor/libvendor/src/conf.c
new file mode 100644
index 0000000..61098ba
--- /dev/null
+++ b/vendor/libvendor/src/conf.c
@@ -0,0 +1,199 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2009-2012 Broadcom Corporation
+ *
+ * This program is the proprietary software of Broadcom Corporation and/or its
+ * licensors, and may only be used, duplicated, modified or distributed
+ * pursuant to the terms and conditions of a separate, written license
+ * agreement executed between you and Broadcom (an "Authorized License").
+ * Except as set forth in an Authorized License, Broadcom grants no license
+ * (express or implied), right to use, or waiver of any kind with respect to
+ * the Software, and Broadcom expressly reserves all rights in and to the
+ * Software and all intellectual property rights therein.
+ * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
+ * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
+ * ALL USE OF THE SOFTWARE.
+ *
+ * Except as expressly set forth in the Authorized License,
+ *
+ * 1. This program, including its structure, sequence and organization,
+ * constitutes the valuable trade secrets of Broadcom, and you shall
+ * use all reasonable efforts to protect the confidentiality thereof,
+ * and to use this information only in connection with your use of
+ * Broadcom integrated circuit products.
+ *
+ * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
+ * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
+ * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
+ * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
+ * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
+ * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
+ * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT
+ * OF USE OR PERFORMANCE OF THE SOFTWARE.
+ *
+ * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR
+ * ITS LICENSORS BE LIABLE FOR
+ * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
+ * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
+ * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
+ * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
+ * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
+ * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
+ * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * Filename: conf.c
+ *
+ * Description: Contains functions to conduct run-time module configuration
+ * based on entries present in the .conf file
+ *
+ ******************************************************************************/
+
+#define LOG_TAG "bt_vnd_conf"
+
+#include <utils/Log.h>
+#include <string.h>
+#include "bt_vendor_brcm.h"
+
+/******************************************************************************
+** Externs
+******************************************************************************/
+int userial_set_port(char *p_conf_name, char *p_conf_value, int param);
+int hw_set_patch_file_path(char *p_conf_name, char *p_conf_value, int param);
+int btsnoop_set_logfile(char *p_conf_name, char *p_conf_value, int param);
+int btsnoop_enable_logging(char *p_conf_name, char *p_conf_value, int param);
+int debug_cfg(char *p_conf_name, char *p_conf_value, int param);
+
+
+/******************************************************************************
+** Local type definitions
+******************************************************************************/
+
+#define CONF_COMMENT '#'
+#define CONF_DELIMITERS " =\n\r\t"
+#define CONF_VALUES_DELIMITERS "=\n\r\t"
+#define CONF_MAX_LINE_LEN 255
+
+typedef int (conf_action_t)(char *p_conf_name, char *p_conf_value, int param);
+
+typedef struct {
+ const char *conf_entry;
+ conf_action_t *p_action;
+ int param;
+} conf_entry_t;
+
+/******************************************************************************
+** Static variables
+******************************************************************************/
+
+/*
+ * Current supported entries and corresponding action functions
+ */
+static const conf_entry_t conf_table[] = {
+ {"UartPort", userial_set_port, 0},
+ {"FwPatchFilePath", hw_set_patch_file_path, 0},
+ {"EnableDebug", debug_cfg, DEBUG_ON},
+ {"BtSnoopLogOutput", btsnoop_enable_logging, 0},
+ {"BtSnoopFileName", btsnoop_set_logfile, 0},
+ {"VndDebug", debug_cfg, TRACE_VND},
+ {"HwDebug", debug_cfg, TRACE_HW},
+ {"UserialDebug", debug_cfg, TRACE_USERIAL},
+ {"HciDebug", debug_cfg, TRACE_HCI},
+ {"UpioDebug", debug_cfg, TRACE_UPIO},
+ {"BtSnoopDebug", debug_cfg, TRACE_BTSNOOP},
+ {(const char *) NULL, NULL, 0}
+};
+
+int debug_cfg(char *p_conf_name, char *p_conf_value, int param)
+{
+ uint8_t enabled = (strcmp(p_conf_value, "true") == 0) ? 1 : 0;
+
+ if (param == DEBUG_ON)
+ {
+ dbg_mode = (enabled == 1) ? DEBUG_ON : DEBUG_OFF;
+ }
+ else
+ {
+ if (enabled == 1)
+ traces |= (1 << param);
+ else
+ traces &= ~(1 << param);
+ }
+
+ return 0;
+}
+
+/*****************************************************************************
+** CONF INTERFACE FUNCTIONS
+*****************************************************************************/
+
+/*******************************************************************************
+**
+** Function vnd_load_conf
+**
+** Description Read conf entry from p_path file one by one and call
+** the corresponding config function
+**
+** Returns None
+**
+*******************************************************************************/
+void vnd_load_conf(const char *p_path)
+{
+ FILE *p_file;
+ char *p_name;
+ char *p_value;
+ conf_entry_t *p_entry;
+ char line[CONF_MAX_LINE_LEN+1]; /* add 1 for \0 char */
+
+ LOGI("Attempt to load conf from %s", p_path);
+
+ if ((p_file = fopen(p_path, "r")) != NULL)
+ {
+ /* read line by line */
+ while (fgets(line, CONF_MAX_LINE_LEN+1, p_file) != NULL)
+ {
+ if (line[0] == CONF_COMMENT)
+ continue;
+
+ p_name = strtok(line, CONF_DELIMITERS);
+
+ if (NULL == p_name)
+ {
+ continue;
+ }
+
+ p_value = strtok(NULL, CONF_DELIMITERS);
+
+ if (NULL == p_value)
+ {
+ LOGW("vnd_load_conf: missing value for name: %s", p_name);
+ continue;
+ }
+
+ p_entry = (conf_entry_t *)conf_table;
+
+ while (p_entry->conf_entry != NULL)
+ {
+ if (strcmp(p_entry->conf_entry, (const char *)p_name) == 0)
+ {
+ p_entry->p_action(p_name, p_value, p_entry->param);
+ break;
+ }
+
+ p_entry++;
+ }
+ }
+
+ fclose(p_file);
+ }
+ else
+ {
+ LOGI( "vnd_load_conf file >%s< not found", p_path);
+ }
+}
+
diff --git a/vendor/libvendor/src/hardware.c b/vendor/libvendor/src/hardware.c
index 886a905..c65caa4 100644
--- a/vendor/libvendor/src/hardware.c
+++ b/vendor/libvendor/src/hardware.c
@@ -81,9 +81,11 @@
#endif
#if (BTHW_DBG == TRUE)
-#define BTHWDBG LOGD
+#define BTHWDBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_HW)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define BTHWDBG
+#define BTHWDBG(param, ...) {}
#endif
#define FW_PATCHFILE_EXTENSION ".hcd"
@@ -201,6 +203,7 @@ uint8_t hci_h4_send_int_cmd(uint16_t opcode, VND_BT_HDR *p_buf, \
** Static variables
******************************************************************************/
+static char fw_patchfile_path[256] = FW_PATCHFILE_LOCATION;
static uint8_t local_bd_addr[BD_ADDR_LEN]={0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t null_bdaddr[BD_ADDR_LEN] = {0,0,0,0,0,0};
@@ -305,7 +308,7 @@ static uint8_t hw_config_findpatch(char *p_chip_id_str)
BTHWDBG("Target name = [%s]", p_chip_id_str);
- if ((dirp = opendir(FW_PATCHFILE_LOCATION)) != NULL)
+ if ((dirp = opendir(fw_patchfile_path)) != NULL)
{
/* Fetch next filename in patchfile directory */
while ((dp = readdir(dirp)) != NULL)
@@ -324,10 +327,10 @@ static uint8_t hw_config_findpatch(char *p_chip_id_str)
) == 0))
{
LOGI("Found patchfile: %s/%s", \
- FW_PATCHFILE_LOCATION, dp->d_name);
+ fw_patchfile_path, dp->d_name);
/* Make sure length does not exceed maximum */
- if ((filenamelen + strlen(FW_PATCHFILE_LOCATION)) > \
+ if ((filenamelen + strlen(fw_patchfile_path)) > \
FW_PATCHFILE_PATH_MAXLEN)
{
LOGE("Invalid patchfile name (too long)");
@@ -336,9 +339,9 @@ static uint8_t hw_config_findpatch(char *p_chip_id_str)
{
memset(p_chip_id_str, 0, FW_PATCHFILE_PATH_MAXLEN);
/* Found patchfile. Store location and name */
- strcpy(p_chip_id_str, FW_PATCHFILE_LOCATION);
- if (FW_PATCHFILE_LOCATION[ \
- strlen(FW_PATCHFILE_LOCATION)- 1 \
+ strcpy(p_chip_id_str, fw_patchfile_path);
+ if (fw_patchfile_path[ \
+ strlen(fw_patchfile_path)- 1 \
] != '/')
{
strcat(p_chip_id_str, "/");
@@ -381,7 +384,7 @@ static uint8_t hw_config_findpatch(char *p_chip_id_str)
}
else
{
- LOGE("Could not open %s", FW_PATCHFILE_LOCATION);
+ LOGE("Could not open %s", fw_patchfile_path);
}
return (retval);
@@ -1327,3 +1330,21 @@ void hw_sco_config(void)
}
#endif // SCO_CFG_INCLUDED
+/*******************************************************************************
+**
+** Function hw_set_patch_file_path
+**
+** Description Set the location of firmware patch file
+**
+** Returns 0 : Success
+** Otherwise : Fail
+**
+*******************************************************************************/
+int hw_set_patch_file_path(char *p_conf_name, char *p_conf_value, int param)
+{
+
+ strcpy(fw_patchfile_path, p_conf_value);
+
+ return 0;
+}
+
diff --git a/vendor/libvendor/src/hci_h4.c b/vendor/libvendor/src/hci_h4.c
index e17c57a..f958951 100644
--- a/vendor/libvendor/src/hci_h4.c
+++ b/vendor/libvendor/src/hci_h4.c
@@ -71,9 +71,11 @@
#endif
#if (HCIH4_DBG == TRUE)
-#define HCIH4DBG LOGD
+#define HCIH4DBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_HCI)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define HCIH4DBG
+#define HCIH4DBG(param, ...) {}
#endif
/* Preamble length for HCI Commands:
@@ -209,30 +211,6 @@ static tHCI_H4_CB h4_cb;
/*******************************************************************************
**
-** Function is_snoop_enabled
-**
-** Description Enable bt snoop
-**
-** Returns TRUE(enabled)/FALSE
-**
-*******************************************************************************/
-static uint8_t is_snoop_enabled()
-{
- char buf[8];
- int flag = 0;
- int fd = open(SNOOP_CONFIG_PATH, O_RDONLY, 0644);
-
- if (fd < 0) {
- LOGE("file failed to open %s ", SNOOP_CONFIG_PATH);
- return FALSE;
- }
- read(fd, buf, sizeof(buf));
- flag = atoi(buf);
- return (flag == 1) ? TRUE : FALSE;
-}
-
-/*******************************************************************************
-**
** Function get_acl_data_length_cback
**
** Description Callback function for HCI_READ_BUFFER_SIZE and
@@ -600,10 +578,7 @@ void hci_h4_init(void)
h4_cb.hc_ble_acl_data_size = 27;
btsnoop_init();
- if (is_snoop_enabled() == TRUE)
- {
- btsnoop_open();
- }
+ btsnoop_open();
}
/*******************************************************************************
diff --git a/vendor/libvendor/src/upio.c b/vendor/libvendor/src/upio.c
index f26ff45..b156cb6 100644
--- a/vendor/libvendor/src/upio.c
+++ b/vendor/libvendor/src/upio.c
@@ -74,9 +74,11 @@
#endif
#if (UPIO_DBG == TRUE)
-#define UPIODBG LOGD
+#define UPIODBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_UPIO)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define UPIODBG LOGV
+#define UPIODBG(param, ...) {}
#endif
/******************************************************************************
diff --git a/vendor/libvendor/src/userial.c b/vendor/libvendor/src/userial.c
index 1083505..f806688 100644
--- a/vendor/libvendor/src/userial.c
+++ b/vendor/libvendor/src/userial.c
@@ -75,9 +75,11 @@
#endif
#if (USERIAL_DBG == TRUE)
-#define USERIALDBG LOGD
+#define USERIALDBG(param, ...) {if (dbg_mode & traces & (1 << TRACE_USERIAL)) \
+ LOGD(param, ## __VA_ARGS__);\
+ }
#else
-#define USERIALDBG
+#define USERIALDBG(param, ...) {}
#endif
#define MAX_SERIAL_PORT (USERIAL_PORT_3 + 1)
@@ -439,7 +441,7 @@ uint8_t userial_open(uint8_t port, tUSERIAL_CFG *p_cfg)
struct sched_param param;
int policy;
pthread_attr_t thread_attr;
- char device_name[20];
+ char device_name[32];
USERIALDBG("userial_open(port:%d, baud:%d)", port, p_cfg->baud);
@@ -694,7 +696,7 @@ void userial_change_baud(uint8_t baud)
USERIALDBG("userial_change_baud: Closing UART Port");
userial_close();
- utils_delay(50);
+ utils_delay(100);
/* change baud rate in settings - leave everything else the same */
userial_cb.cfg.baud = baud;
@@ -750,3 +752,20 @@ void userial_ioctl(userial_ioctl_op_t op, void *p_data)
}
}
+/*******************************************************************************
+**
+** Function userial_set_port
+**
+** Description Configure UART port name
+**
+** Returns 0 : Success
+** Otherwise : Fail
+**
+*******************************************************************************/
+int userial_set_port(char *p_conf_name, char *p_conf_value, int param)
+{
+ strcpy(userial_dev[USERIAL_PORT_1], p_conf_value);
+
+ return 0;
+}
+