OSDN Git Service

Solve compilation problem when BLE/GATT/SMP features are false
authorMatthew Xie <mattx@google.com>
Tue, 7 May 2013 03:51:02 +0000 (20:51 -0700)
committerThe Android Automerger <android-build@android.com>
Thu, 9 May 2013 23:15:42 +0000 (16:15 -0700)
bug 8664724
Change-Id: I582846ccf4b8995f298d8db533488fceb7993ae3

bta/dm/bta_dm_int.h
bta/include/bta_api.h
btif/co/bta_dm_co.c
btif/src/bluetooth.c
btif/src/btif_dm.c
btif/src/btif_gatt_util.c
btif/src/btif_storage.c
stack/btm/btm_ble.c
stack/btm/btm_devctl.c
test/bluedroidtest/bluedroidtest.c

index 3ca57a7..ca34356 100644 (file)
@@ -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
index 26302bc..087446e 100644 (file)
@@ -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
 }
index a310a00..fd91817 100644 (file)
@@ -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
 
 /*******************************************************************************
 **
index f62bf28..a412296 100755 (executable)
@@ -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 ()
index 3854ebd..a2a7410 100644 (file)
@@ -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  */
index 34635a5..3775776 100644 (file)
@@ -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
index 9843530..a113d48 100644 (file)
@@ -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));
index 0400df4..3fa9fcd 100644 (file)
@@ -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
 *******************************************************************************/
index 79b2350..7f56d2c 100644 (file)
@@ -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();
         }
index 9cdd42d..2b517df 100644 (file)
@@ -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)