OSDN Git Service

Remove always true definition BTM_EIR_CLIENT_INCLUDED
authorChris Manton <cmanton@google.com>
Fri, 24 Oct 2014 16:00:13 +0000 (09:00 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 16 Mar 2015 23:51:38 +0000 (16:51 -0700)
bta/dm/bta_dm_act.c
bta/dm/bta_dm_api.c
include/bt_target.h
stack/btm/btm_inq.c
stack/btm/btm_int.h
stack/btu/btu_hcif.c
stack/include/btm_api.h

index 507c452..cf3de50 100644 (file)
@@ -73,11 +73,9 @@ static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data);
 static void bta_dm_set_eir (char *local_name);
 #endif /* BTM_EIR_SERVER_INCLUDED */
 
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 static void bta_dm_eir_search_services( tBTM_INQ_RESULTS  *p_result,
                                         tBTA_SERVICE_MASK *p_services_to_search,
                                         tBTA_SERVICE_MASK *p_services_found);
-#endif /* BTM_EIR_CLIENT_INCLUDED */
 
 static void bta_dm_rssi_cback (tBTM_RSSI_RESULTS *p_result);
 static void bta_dm_signal_strength_timer_cback (TIMER_LIST_ENT *p_tle);
@@ -2003,10 +2001,8 @@ void bta_dm_search_result (tBTA_DM_MSG *p_data)
     /* if searching did not initiate to create link */
     if(!bta_dm_search_cb.wait_disc )
     {
-#if ( BTM_EIR_CLIENT_INCLUDED == TRUE )
         /* if service searching is done with EIR, don't search next device */
         if( bta_dm_search_cb.p_btm_inq_info )
-#endif
         bta_dm_discover_next_device();
     }
     else
@@ -2456,7 +2452,6 @@ static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
         bta_dm_search_cb.uuid_to_search     = bta_dm_search_cb.num_uuid;
 #endif
-#if ( BTM_EIR_CLIENT_INCLUDED == TRUE )
         if ((bta_dm_search_cb.p_btm_inq_info != NULL) &&
                        bta_dm_search_cb.services != BTA_USER_SERVICE_MASK
             &&(bta_dm_search_cb.sdp_search == FALSE))
@@ -2469,7 +2464,6 @@ static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
 
         /* if seaching with EIR is not completed */
         if(bta_dm_search_cb.services_to_search)
-#endif
         {
             /* check whether connection already exists to the device
                if connection exists, we don't have to wait for ACL
@@ -4449,7 +4443,6 @@ static void bta_dm_set_eir (char *local_name)
 }
 #endif
 
-#if ( BTM_EIR_CLIENT_INCLUDED == TRUE )
 /*******************************************************************************
 **
 ** Function         bta_dm_eir_search_services
@@ -4523,7 +4516,6 @@ static void bta_dm_eir_search_services( tBTM_INQ_RESULTS  *p_result,
     APPL_TRACE_ERROR("BTA EIR search result, services_to_search=0x%08X, services_found=0x%08X",
                         *p_services_to_search, *p_services_found);
 }
-#endif
 
 #if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&(BTA_EIR_CANNED_UUID_LIST != TRUE)
 /*******************************************************************************
index 8c1be19..589c471 100644 (file)
@@ -1017,11 +1017,7 @@ void BTA_DmSetEIRConfig (tBTA_DM_EIR_CONF *p_eir_cfg)
 *******************************************************************************/
 UINT8 *BTA_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length )
 {
-#if ( BTM_EIR_CLIENT_INCLUDED == TRUE )
     return BTM_CheckEirData( p_eir, type, p_length );
-#else
-    return NULL;
-#endif
 }
 
 /*******************************************************************************
@@ -1039,7 +1035,6 @@ UINT8 *BTA_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length )
 extern const UINT16 bta_service_id_to_uuid_lkup_tbl [];
 void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services )
 {
-#if ( BTM_EIR_CLIENT_INCLUDED == TRUE )
     UINT8 xx, yy;
     UINT8 num_uuid, max_num_uuid = 32;
     UINT8 uuid_list[32*LEN_UUID_16];
@@ -1070,7 +1065,6 @@ void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services )
         if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SINK)
             *p_services |= BTA_HL_SERVICE_MASK;
     }
-#endif
 }
 
 /*******************************************************************************
index 1968834..022bacc 100644 (file)
@@ -611,12 +611,6 @@ extern "C" {
 #define BTM_EIR_SERVER_INCLUDED         TRUE
 #endif
 
-/* This is set to TRUE if the client Extended Inquiry Response feature is desired. */
-/* client inquiry to server */
-#ifndef BTM_EIR_CLIENT_INCLUDED
-#define BTM_EIR_CLIENT_INCLUDED         TRUE
-#endif
-
 /* This is set to TRUE if the FEC is required for EIR packet. */
 #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
 #define BTM_EIR_DEFAULT_FEC_REQUIRED    TRUE
index f425eb8..a126f19 100644 (file)
@@ -51,7 +51,6 @@
 static const LAP general_inq_lap = {0x9e,0x8b,0x33};
 static const LAP limited_inq_lap = {0x9e,0x8b,0x00};
 
-#if (( BTM_EIR_CLIENT_INCLUDED == TRUE )||( BTM_EIR_SERVER_INCLUDED == TRUE ))
 #ifndef BTM_EIR_UUID_LKUP_TBL
 const UINT16 BTM_EIR_UUID_LKUP_TBL[BTM_EIR_MAX_SERVICES] =
 {
@@ -125,7 +124,7 @@ const UINT16 BTM_EIR_UUID_LKUP_TBL[BTM_EIR_MAX_SERVICES] =
     UUID_SERVCLASS_HDP_SOURCE,
     UUID_SERVCLASS_HDP_SINK
 };
-#else
+#else  // BTM_EIR_UUID_LKUP_TBL
 /*
 If customized UUID look-up table needs to be used,
 the followings should be defined in bdroid_buildcfg.h.
@@ -134,11 +133,10 @@ BTM_EIR_MAX_SERVICES = <number of UUID in list>
 */
 #if (BTM_EIR_MAX_SERVICES == 0)
 const UINT16 BTM_EIR_UUID_LKUP_TBL[];
-#else
+#else  // BTM_EIR_MAX_SERVICES
 extern UINT16 BTM_EIR_UUID_LKUP_TBL[BTM_EIR_MAX_SERVICES];
-#endif
-#endif
-#endif /* BTM_EIR_UUID_LKUP_TBL*/
+#endif  // BTM_EIR_MAX_SERVICES
+#endif  // BTM_EIR_UUID_LKUP_TBL
 
 /********************************************************************************/
 /*              L O C A L    F U N C T I O N     P R O T O T Y P E S            */
@@ -147,15 +145,11 @@ static void         btm_initiate_inquiry (tBTM_INQUIRY_VAR_ST *p_inq);
 static tBTM_STATUS  btm_set_inq_event_filter (UINT8 filter_cond_type, tBTM_INQ_FILT_COND *p_filt_cond);
 static void         btm_clr_inq_result_flt (void);
 
-#if ((BTM_EIR_SERVER_INCLUDED == TRUE)||(BTM_EIR_CLIENT_INCLUDED == TRUE))
 static UINT8        btm_convert_uuid_to_eir_service( UINT16 uuid16 );
-#endif
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 static void         btm_set_eir_uuid( UINT8 *p_eir, tBTM_INQ_RESULTS *p_results );
 static UINT8       *btm_eir_get_uuid_list( UINT8 *p_eir, UINT8 uuid_size,
                                            UINT8 *p_num_uuid, UINT8 *p_uuid_list_type );
 static UINT16       btm_convert_uuid_to_uuid16( UINT8 *p_uuid, UINT8 uuid_size );
-#endif
 
 /*******************************************************************************
 **
@@ -401,13 +395,11 @@ tBTM_STATUS BTM_SetInquiryMode (UINT8 mode)
         if (!controller->supports_rssi_with_inquiry_results())
             return (BTM_MODE_UNSUPPORTED);
     }
-#if (( BTM_EIR_CLIENT_INCLUDED == TRUE )||( BTM_EIR_SERVER_INCLUDED == TRUE ))
     else if (mode == BTM_INQ_RESULT_EXTENDED)
     {
         if (!controller->supports_extended_inquiry_response())
             return (BTM_MODE_UNSUPPORTED);
     }
-#endif
     else
         return (BTM_ILLEGAL_VALUE);
 
@@ -2025,9 +2017,7 @@ void btm_process_inq_results (UINT8 *p, UINT8 inq_res_mode)
     UINT8            rssi = 0;
     DEV_CLASS        dc;
     UINT16           clock_offset;
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
     UINT8            *p_eir_data = NULL;
-#endif
 
 #if (BTM_INQ_DEBUG == TRUE)
     BTM_TRACE_DEBUG ("btm_process_inq_results inq_active:0x%x state:%d inqfilt_active:%d",
@@ -2204,7 +2194,6 @@ void btm_process_inq_results (UINT8 *p, UINT8 inq_res_mode)
 
         if (is_new || update)
         {
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
             if( inq_res_mode == BTM_INQ_RESULT_EXTENDED )
             {
                 memset( p_cur->eir_uuid, 0,
@@ -2215,15 +2204,10 @@ void btm_process_inq_results (UINT8 *p, UINT8 inq_res_mode)
             }
             else
                 p_eir_data = NULL;
-#endif
 
             /* If a callback is registered, call it with the results */
             if (p_inq_results_cb)
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
                 (p_inq_results_cb)((tBTM_INQ_RESULTS *) p_cur, p_eir_data);
-#else
-                (p_inq_results_cb)((tBTM_INQ_RESULTS *) p_cur, NULL);
-#endif
         }
     }
 }
@@ -2682,7 +2666,6 @@ tBTM_STATUS BTM_WriteEIR( BT_HDR *p_buff )
 *******************************************************************************/
 UINT8 *BTM_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length )
 {
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
     UINT8 *p = p_eir;
     UINT8 length;
     UINT8 eir_type;
@@ -2704,9 +2687,6 @@ UINT8 *BTM_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length )
 
     *p_length = 0;
     return NULL;
-#else
-    return NULL;
-#endif
 }
 
 /*******************************************************************************
@@ -2721,7 +2701,6 @@ UINT8 *BTM_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length )
 **                  BTM_EIR_MAX_SERVICES - if not found
 **
 *******************************************************************************/
-#if (( BTM_EIR_CLIENT_INCLUDED == TRUE )||( BTM_EIR_SERVER_INCLUDED == TRUE ))
 static UINT8 btm_convert_uuid_to_eir_service( UINT16 uuid16 )
 {
     UINT8 xx;
@@ -2735,7 +2714,6 @@ static UINT8 btm_convert_uuid_to_eir_service( UINT16 uuid16 )
     }
     return BTM_EIR_MAX_SERVICES;
 }
-#endif
 
 /*******************************************************************************
 **
@@ -2752,7 +2730,6 @@ static UINT8 btm_convert_uuid_to_eir_service( UINT16 uuid16 )
 *******************************************************************************/
 BOOLEAN BTM_HasEirService( UINT32 *p_eir_uuid, UINT16 uuid16 )
 {
-#if ((BTM_EIR_SERVER_INCLUDED == TRUE)||(BTM_EIR_CLIENT_INCLUDED == TRUE))
     UINT8 service_id;
 
     service_id = btm_convert_uuid_to_eir_service(uuid16);
@@ -2760,9 +2737,6 @@ BOOLEAN BTM_HasEirService( UINT32 *p_eir_uuid, UINT16 uuid16 )
         return( BTM_EIR_HAS_SERVICE( p_eir_uuid, service_id ));
     else
         return( FALSE );
-#else
-    return( FALSE );
-#endif
 }
 
 /*******************************************************************************
@@ -2781,7 +2755,6 @@ BOOLEAN BTM_HasEirService( UINT32 *p_eir_uuid, UINT16 uuid16 )
 *******************************************************************************/
 tBTM_EIR_SEARCH_RESULT BTM_HasInquiryEirService( tBTM_INQ_RESULTS *p_results, UINT16 uuid16 )
 {
-#if ((BTM_EIR_SERVER_INCLUDED == TRUE)||(BTM_EIR_CLIENT_INCLUDED == TRUE))
     if( BTM_HasEirService( p_results->eir_uuid, uuid16 ))
     {
         return BTM_EIR_FOUND;
@@ -2792,9 +2765,6 @@ tBTM_EIR_SEARCH_RESULT BTM_HasInquiryEirService( tBTM_INQ_RESULTS *p_results, UI
     }
     else
         return BTM_EIR_UNKNOWN;
-#else
-    return BTM_EIR_UNKNOWN;
-#endif
 }
 
 /*******************************************************************************
@@ -2811,13 +2781,11 @@ tBTM_EIR_SEARCH_RESULT BTM_HasInquiryEirService( tBTM_INQ_RESULTS *p_results, UI
 *******************************************************************************/
 void BTM_AddEirService( UINT32 *p_eir_uuid, UINT16 uuid16 )
 {
-#if ((BTM_EIR_SERVER_INCLUDED == TRUE)||(BTM_EIR_CLIENT_INCLUDED == TRUE))
     UINT8 service_id;
 
     service_id = btm_convert_uuid_to_eir_service(uuid16);
     if( service_id < BTM_EIR_MAX_SERVICES )
         BTM_EIR_SET_SERVICE( p_eir_uuid, service_id );
-#endif
 }
 
 /*******************************************************************************
@@ -2912,7 +2880,6 @@ UINT8 BTM_GetEirSupportedServices( UINT32 *p_eir_uuid,    UINT8 **p,
 UINT8 BTM_GetEirUuidList( UINT8 *p_eir, UINT8 uuid_size, UINT8 *p_num_uuid,
                             UINT8 *p_uuid_list, UINT8 max_num_uuid)
 {
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
     UINT8   *p_uuid_data;
     UINT8   type;
     UINT8   yy, xx;
@@ -2963,14 +2930,9 @@ UINT8 BTM_GetEirUuidList( UINT8 *p_eir, UINT8 uuid_size, UINT8 *p_num_uuid,
     }
 
     return type;
-#else
-    *p_num_uuid = 0;
-    return 0x00;
-#endif
 }
 
 
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 /*******************************************************************************
 **
 ** Function         btm_eir_get_uuid_list
@@ -3154,5 +3116,3 @@ void btm_set_eir_uuid( UINT8 *p_eir, tBTM_INQ_RESULTS *p_results )
         }
     }
 }
-#endif
-
index 0bc3a2d..5e1f4fa 100644 (file)
@@ -941,9 +941,7 @@ extern void         btm_inq_clear_ssp(void);
 extern tINQ_DB_ENT *btm_inq_db_find (BD_ADDR p_bda);
 extern BOOLEAN      btm_inq_find_bdaddr (BD_ADDR p_bda);
 
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 extern BOOLEAN btm_lookup_eir(BD_ADDR_PTR p_rem_addr);
-#endif
 
 /* Internal functions provided by btm_acl.c
 ********************************************
index b01e77e..bcce235 100644 (file)
@@ -71,9 +71,7 @@ extern void btm_ble_test_command_complete(UINT8 *p);
 static void btu_hcif_inquiry_comp_evt (UINT8 *p);
 static void btu_hcif_inquiry_result_evt (UINT8 *p);
 static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p);
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 static void btu_hcif_extended_inquiry_result_evt (UINT8 *p);
-#endif
 
 static void btu_hcif_connection_comp_evt (UINT8 *p);
 static void btu_hcif_connection_request_evt (UINT8 *p);
@@ -174,11 +172,9 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
         case HCI_INQUIRY_RSSI_RESULT_EVT:
             btu_hcif_inquiry_rssi_result_evt (p);
             break;
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
         case HCI_EXTENDED_INQUIRY_RESULT_EVT:
             btu_hcif_extended_inquiry_result_evt (p);
             break;
-#endif
         case HCI_CONNECTION_COMP_EVT:
             btu_hcif_connection_comp_evt (p);
             break;
@@ -493,13 +489,11 @@ static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p)
 ** Returns          void
 **
 *******************************************************************************/
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
 static void btu_hcif_extended_inquiry_result_evt (UINT8 *p)
 {
     /* Store results in the cache */
     btm_process_inq_results (p, BTM_INQ_RESULT_EXTENDED);
 }
-#endif
 
 /*******************************************************************************
 **
index 7307ad5..6929aec 100644 (file)
@@ -611,10 +611,8 @@ typedef struct
     UINT8       page_scan_per_mode;
     UINT8       page_scan_mode;
     INT8        rssi;       /* Set to BTM_INQ_RES_IGNORE_RSSI if  not valid */
-#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
     UINT32      eir_uuid[BTM_EIR_SERVICE_ARRAY_SIZE];
     BOOLEAN     eir_complete_list;
-#endif
 #if (BLE_INCLUDED == TRUE)
     tBT_DEVICE_TYPE         device_type;
     UINT8       inq_result_type;