diff options
author | Matthew Xie <mattx@google.com> | 2013-05-06 20:51:02 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2013-05-08 18:07:40 -0700 |
commit | fc4b2f1953dbe60464d0f5ef7daaa10001fbc62f (patch) | |
tree | 6cb1ac6751f9c5927ec3a325d62c5bf8610ad9cc | |
parent | 2154e12efeec88780933d47b3c3686ff9f6fe84d (diff) | |
download | bluedroid-fc4b2f1953dbe60464d0f5ef7daaa10001fbc62f.tar.gz |
Solve compilation problem when BLE/GATT/SMP features are false
bug 8664724
Change-Id: I582846ccf4b8995f298d8db533488fceb7993ae3
-rw-r--r-- | bta/dm/bta_dm_int.h | 13 | ||||
-rw-r--r-- | bta/include/bta_api.h | 3 | ||||
-rw-r--r-- | btif/co/bta_dm_co.c | 2 | ||||
-rwxr-xr-x | btif/src/bluetooth.c | 10 | ||||
-rw-r--r-- | btif/src/btif_dm.c | 2 | ||||
-rw-r--r-- | btif/src/btif_gatt_util.c | 5 | ||||
-rw-r--r-- | btif/src/btif_storage.c | 2 | ||||
-rw-r--r-- | stack/btm/btm_ble.c | 4 | ||||
-rw-r--r-- | stack/btm/btm_devctl.c | 2 | ||||
-rw-r--r-- | test/bluedroidtest/bluedroidtest.c | 6 |
10 files changed, 37 insertions, 12 deletions
diff --git a/bta/dm/bta_dm_int.h b/bta/dm/bta_dm_int.h index 3ca57a7..ca34356 100644 --- a/bta/dm/bta_dm_int.h +++ b/bta/dm/bta_dm_int.h @@ -510,13 +510,6 @@ typedef struct tBTA_DM_SEARCH_CBACK * p_cback; }tBTA_DM_API_BLE_OBSERVE; -typedef struct -{ - BT_HDR hdr; - BOOLEAN enable_or_disable; -}tBTA_DM_API_SET_AFH_CHANNEL_ASSESSMENT; - - /* set adv parameter for BLE advertising */ typedef struct { @@ -535,6 +528,12 @@ typedef struct #endif +typedef struct +{ + BT_HDR hdr; + BOOLEAN enable_or_disable; +}tBTA_DM_API_SET_AFH_CHANNEL_ASSESSMENT; + #if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&( BTA_EIR_CANNED_UUID_LIST != TRUE )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0) /* data type for BTA_DM_API_UPDATE_EIR_UUID_EVT */ typedef struct diff --git a/bta/include/bta_api.h b/bta/include/bta_api.h index 26302bc..087446e 100644 --- a/bta/include/bta_api.h +++ b/bta/include/bta_api.h @@ -1862,6 +1862,8 @@ BTA_API extern void BTA_DmBleObserve(BOOLEAN start, UINT8 duration, ** *******************************************************************************/ BTA_API extern void BTA_DmSetAfhChannelAssessment (BOOLEAN enable_or_disable); + +#if BLE_INCLUDE == TRUE // btla-specific -- /******************************************************************************* ** @@ -1904,6 +1906,7 @@ BTA_API extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privac *******************************************************************************/ BTA_API extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_adv_cfg); +#endif #ifdef __cplusplus } diff --git a/btif/co/bta_dm_co.c b/btif/co/bta_dm_co.c index a310a00..fd91817 100644 --- a/btif/co/bta_dm_co.c +++ b/btif/co/bta_dm_co.c @@ -27,9 +27,9 @@ #endif #if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE) #include "bte_appl.h" -#endif tBTE_APPL_CFG bte_appl_cfg = { 0x5, 0x4, 0x7, 0x7, 0x10 }; +#endif /******************************************************************************* ** diff --git a/btif/src/bluetooth.c b/btif/src/bluetooth.c index f62bf28..a412296 100755 --- a/btif/src/bluetooth.c +++ b/btif/src/bluetooth.c @@ -326,8 +326,10 @@ static const void* get_profile_interface (const char *profile_id) if (is_profile(profile_id, BT_PROFILE_HEALTH_ID)) return btif_hl_get_interface(); +#if BTA_GATT_INCLUDED == TRUE if (is_profile(profile_id, BT_PROFILE_GATT_ID)) return btif_gatt_get_interface(); +#endif if (is_profile(profile_id, BT_PROFILE_AV_RC_ID)) return btif_rc_get_interface(); @@ -356,6 +358,8 @@ int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) return btif_dut_mode_send(opcode, buf, len); } + +#if BLE_INCLUDED == TRUE int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len) { ALOGI("le_test_mode"); @@ -366,7 +370,7 @@ int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len) return btif_le_test_mode(opcode, buf, len); } - +#endif static const bt_interface_t bluetoothInterface = { sizeof(bluetoothInterface), @@ -392,7 +396,11 @@ static const bt_interface_t bluetoothInterface = { get_profile_interface, dut_mode_configure, dut_mode_send, +#if BLE_INCLUDED == TRUE le_test_mode +#else + NULL +#endif }; const bt_interface_t* bluetooth__get_bluetooth_interface () diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c index 5a7cccd..f947e84 100644 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -479,6 +479,7 @@ static void btif_dm_cb_create_bond(bt_bdaddr_t *bd_addr) } else { +#if BLE_INCLUDED == TRUE int device_type; int addr_type; bdstr_t bdstr; @@ -489,6 +490,7 @@ static void btif_dm_cb_create_bond(bt_bdaddr_t *bd_addr) { BTA_DmAddBleDevice(bd_addr->address, addr_type, BT_DEVICE_TYPE_BLE); } +#endif BTA_DmBond ((UINT8 *)bd_addr->address); } /* Track originator of bond creation */ diff --git a/btif/src/btif_gatt_util.c b/btif/src/btif_gatt_util.c index 34635a5..3775776 100644 --- a/btif/src/btif_gatt_util.c +++ b/btif/src/btif_gatt_util.c @@ -16,7 +16,6 @@ * ******************************************************************************/ - #include <hardware/bluetooth.h> #include <hardware/bt_gatt.h> #include <stdio.h> @@ -37,6 +36,8 @@ #include "btif_gatt.h" #include "btif_gatt_util.h" +#if BTA_GATT_INCLUDED == TRUE + #define GATTC_READ_VALUE_TYPE_VALUE 0x0000 /* Attribute value itself */ #define GATTC_READ_VALUE_TYPE_AGG_FORMAT 0x2905 /* Characteristic Aggregate Format*/ @@ -355,3 +356,5 @@ void btif_gatt_check_encrypted_link (BD_ADDR bd_addr) &btif_gatt_set_encryption_cb, BTM_BLE_SEC_ENCRYPT); } } + +#endif diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c index 9843530..a113d48 100644 --- a/btif/src/btif_storage.c +++ b/btif/src/btif_storage.c @@ -496,11 +496,13 @@ static bt_status_t btif_in_fetch_bonded_devices(btif_bonded_devices_t *p_bonded_ uint2devclass((UINT32)cod, dev_class); BTA_DmAddDevice(bd_addr.address, dev_class, link_key, 0, 0, (UINT8)linkkey_type, 0); +#if BLE_INCLUDED == TRUE if (btif_config_get_int("Remote", kname, "DevType", &device_type) && (device_type == BT_DEVICE_TYPE_DUMO) ) { btif_gatts_add_bonded_dev_from_nv(bd_addr.address); } +#endif } bt_linkkey_file_found = TRUE; memcpy(&p_bonded_devices->devices[p_bonded_devices->num_devices++], &bd_addr, sizeof(bt_bdaddr_t)); diff --git a/stack/btm/btm_ble.c b/stack/btm/btm_ble.c index 0400df4..3fa9fcd 100644 --- a/stack/btm/btm_ble.c +++ b/stack/btm/btm_ble.c @@ -586,6 +586,8 @@ void BTM_ReadDevInfo (BD_ADDR remote_bda, tBT_DEVICE_TYPE *p_dev_type, tBLE_ADDR return; } +#if BLE_INCLUDED == TRUE + /******************************************************************************* ** ** Function BTM_BleReceiverTest @@ -647,6 +649,8 @@ void BTM_BleTestEnd(tBTM_CMPL_CB *p_cmd_cmpl_cback) } } +#endif + /******************************************************************************* ** Internal Functions *******************************************************************************/ diff --git a/stack/btm/btm_devctl.c b/stack/btm/btm_devctl.c index 79b2350..7f56d2c 100644 --- a/stack/btm/btm_devctl.c +++ b/stack/btm/btm_devctl.c @@ -1227,13 +1227,13 @@ static void btm_issue_host_support_for_lmp_features (void) { btm_read_ble_wl_size(); } + else #elif BTM_INTERNAL_BB == TRUE { UINT8 buf[9] = BTM_INTERNAL_LOCAL_FEA; btm_read_local_features_complete( buf, 9 ); } #endif - else { btm_reset_ctrlr_complete(); } diff --git a/test/bluedroidtest/bluedroidtest.c b/test/bluedroidtest/bluedroidtest.c index 9cdd42d..2b517df 100644 --- a/test/bluedroidtest/bluedroidtest.c +++ b/test/bluedroidtest/bluedroidtest.c @@ -492,8 +492,12 @@ static bt_callbacks_t bt_callbacks = { NULL, /* acl_state_changed_cb */ NULL, /* thread_evt_cb */ dut_mode_recv, /*dut_mode_recv_cb */ - NULL, /*authorize_request_cb */ +// NULL, /*authorize_request_cb */ +#if BLE_INCLUDED == TRUE le_test_mode /* le_test_mode_cb */ +#else + NULL +#endif }; void bdt_init(void) |