OSDN Git Service

BTA_HH_LE_INCLUDED is always true
authorZach Johnson <zachoverflow@google.com>
Fri, 28 Aug 2020 23:52:39 +0000 (16:52 -0700)
committerZach Johnson <zachoverflow@google.com>
Sat, 29 Aug 2020 00:34:58 +0000 (17:34 -0700)
stop corrupting the code formatting

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0b5dd0a15c4ab73f2e4a9eb9c01cb3f94b02b2fd

bta/gatt/bta_gattc_act.cc
bta/hh/bta_hh_act.cc
bta/hh/bta_hh_api.cc
bta/hh/bta_hh_int.h
bta/hh/bta_hh_le.cc
bta/hh/bta_hh_main.cc
bta/hh/bta_hh_utils.cc
bta/include/bta_hh_api.h
bta/include/bta_hh_co.h
btif/co/bta_hh_co.cc
internal_include/bt_target.h

index c0e129b..cf28a0d 100644 (file)
@@ -39,9 +39,7 @@
 #include "stack/include/btu.h"
 #include "utl.h"
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #include "bta_hh_int.h"
-#endif
 
 using base::StringPrintf;
 using bluetooth::Uuid;
@@ -139,13 +137,9 @@ void bta_gattc_disable() {
     bta_gattc_cb.state = BTA_GATTC_STATE_DISABLING;
 /* don't deregister HH GATT IF */
 /* HH GATT IF will be deregistered by bta_hh_le_deregister when disable HH */
-#if (BTA_HH_LE_INCLUDED == TRUE)
     if (!bta_hh_le_is_hh_gatt_if(bta_gattc_cb.cl_rcb[i].client_if)) {
-#endif
       bta_gattc_deregister(&bta_gattc_cb.cl_rcb[i]);
-#if (BTA_HH_LE_INCLUDED == TRUE)
     }
-#endif
   }
 
   /* no registered apps, indicate disable completed */
@@ -1070,7 +1064,6 @@ static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, const RawAddress& bda) {
 
   if (p_clcb == NULL) return;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   /* filter this event just for BTA HH LE GATT client,
    * In the future, if we want to enable encryption complete event
    * for all GATT clients, we can remove this code
@@ -1078,7 +1071,6 @@ static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, const RawAddress& bda) {
   if (!bta_hh_le_is_hh_gatt_if(gattc_if)) {
     return;
   }
-#endif
 
   VLOG(1) << __func__ << ": cif:" << +gattc_if;
 
index 48e5e95..0deff65 100644 (file)
@@ -93,11 +93,9 @@ void bta_hh_api_enable(tBTA_HH_DATA* p_data) {
       bta_hh_cb.cb_index[xx] = BTA_HH_IDX_INVALID;
   }
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (status == BTA_HH_OK) {
     bta_hh_le_enable();
   } else
-#endif
   {
     /* signal BTA call back event */
     tBTA_HH bta_hh;
@@ -151,10 +149,8 @@ void bta_hh_api_disable(void) {
  *
  ******************************************************************************/
 void bta_hh_disc_cmpl(void) {
-#if (BTA_HH_LE_INCLUDED == TRUE)
   HID_HostDeregister();
   bta_hh_le_deregister();
-#else
   tBTA_HH_STATUS status = BTA_HH_OK;
 
   /* Deregister with lower layer */
@@ -313,12 +309,10 @@ void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
   p_cb->mode = p_data->api_conn.mode;
   bta_hh_cb.p_cur = p_cb;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr)) {
     bta_hh_le_open_conn(p_cb, p_data->api_conn.bd_addr);
     return;
   }
-#endif
 
   /* if previously virtually cabled device, skip SDP */
   if (p_cb->app_id) {
@@ -484,11 +478,9 @@ void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
   tBTA_HH_CBDATA disc_dat;
   tHID_STATUS status;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (p_cb->is_le_device)
     bta_hh_le_api_disc_act(p_cb);
   else
-#endif
   {
     /* found an active connection */
     disc_dat.handle =
@@ -532,22 +524,18 @@ void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
   bta_hh_co_open(p_cb->hid_handle, p_cb->sub_class, p_cb->attr_mask,
                  p_cb->app_id);
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   conn.status = p_cb->status;
   conn.le_hid = p_cb->is_le_device;
   conn.scps_supported = p_cb->scps_supported;
 
   if (!p_cb->is_le_device)
-#endif
   {
     /* inform role manager */
     bta_sys_conn_open(BTA_ID_HH, p_cb->app_id, p_cb->addr);
   }
   /* set protocol mode when not default report mode */
   if (p_cb->mode != BTA_HH_PROTO_RPT_MODE
-#if (BTA_HH_LE_INCLUDED == TRUE)
       && !p_cb->is_le_device
-#endif
       ) {
     if ((HID_HostWriteDev(dev_handle, HID_TRANS_SET_PROTOCOL,
                           HID_PAR_PROTOCOL_BOOT_MODE, 0, 0, NULL)) !=
@@ -909,11 +897,9 @@ void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
  ******************************************************************************/
 void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb,
                          UNUSED_ATTR tBTA_HH_DATA* p_data) {
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (p_cb->is_le_device) {
     bta_hh_le_get_dscp_act(p_cb);
   } else
-#endif
     (*bta_hh_cb.p_cback)(BTA_HH_GET_DSCP_EVT, (tBTA_HH*)&p_cb->dscp_info);
 }
 
@@ -940,31 +926,22 @@ void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
       dev_info.bda = p_dev_info->bda;
       /* initialize callback data */
       if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) {
-#if (BTA_HH_LE_INCLUDED == TRUE)
         if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr)) {
           dev_info.handle = bta_hh_le_add_device(p_cb, p_dev_info);
           if (dev_info.handle != BTA_HH_INVALID_HANDLE)
             dev_info.status = BTA_HH_OK;
         } else
-#endif
 
             if (HID_HostAddDev(p_dev_info->bda, p_dev_info->attr_mask,
                                &dev_handle) == HID_SUCCESS) {
           dev_info.handle = dev_handle;
           dev_info.status = BTA_HH_OK;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
           /* update DI information */
           bta_hh_update_di_info(p_cb, p_dev_info->dscp_info.vendor_id,
                                 p_dev_info->dscp_info.product_id,
                                 p_dev_info->dscp_info.version,
                                 p_dev_info->dscp_info.flag);
-#else
-          bta_hh_update_di_info(p_cb, p_dev_info->dscp_info.vendor_id,
-                                p_dev_info->dscp_info.product_id,
-                                p_dev_info->dscp_info.version, 0);
-
-#endif
           /* add to BTA device list */
           bta_hh_add_device_to_list(
               p_cb, dev_handle, p_dev_info->attr_mask,
@@ -988,13 +965,11 @@ void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
       dev_info.handle = (uint8_t)p_dev_info->hdr.layer_specific;
       dev_info.bda = p_cb->addr;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
       if (p_cb->is_le_device) {
         bta_hh_le_remove_dev_bg_conn(p_cb);
         bta_hh_sm_execute(p_cb, BTA_HH_API_CLOSE_EVT, NULL);
         bta_hh_clean_up_kdev(p_cb);
       } else
-#endif
       {
         if (HID_HostRemoveDev(dev_info.handle) == HID_SUCCESS) {
           dev_info.status = BTA_HH_OK;
@@ -1026,11 +1001,9 @@ void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
   uint16_t event = (p_data->api_sndcmd.t_type - BTA_HH_FST_BTE_TRANS_EVT) +
                    BTA_HH_FST_TRANS_CB_EVT;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (p_cb->is_le_device)
     bta_hh_le_write_dev_act(p_cb, p_data);
   else
-#endif
   {
 
     cbdata.handle = p_cb->hid_handle;
@@ -1247,4 +1220,3 @@ static const char* bta_hh_hid_event_name(uint16_t event) {
   }
 }
 #endif
-#endif /* BTA_HH_INCLUDED */
index 88e32ad..dd3be6b 100644 (file)
@@ -276,14 +276,12 @@ void BTA_HhSendCtrl(uint8_t dev_handle, tBTA_HH_TRANS_CTRL_TYPE c_type) {
  ******************************************************************************/
 void BTA_HhSendData(uint8_t dev_handle, UNUSED_ATTR const RawAddress& dev_bda,
                     BT_HDR* p_data) {
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT) {
     APPL_TRACE_ERROR(
         "ERROR! Wrong report type! Write Command only valid for output "
         "report!");
     return;
   }
-#endif
   bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA,
                        (uint8_t)p_data->layer_specific, 0, 0, p_data);
 }
index 4066757..50eda83 100644 (file)
@@ -29,9 +29,7 @@
 #include "bta_sys.h"
 #include "utl.h"
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #include "bta_gatt_api.h"
-#endif
 
 /* can be moved to bta_api.h */
 #define BTA_HH_MAX_RPT_CHARS 8
@@ -50,13 +48,11 @@ enum {
   BTA_HH_API_GET_DSCP_EVT,
   BTA_HH_API_MAINT_DEV_EVT,
   BTA_HH_OPEN_CMPL_EVT,
-#if (BTA_HH_LE_INCLUDED == TRUE)
   BTA_HH_GATT_CLOSE_EVT,
   BTA_HH_GATT_OPEN_EVT,
   BTA_HH_START_ENC_EVT,
   BTA_HH_ENC_CMPL_EVT,
   BTA_HH_GATT_ENC_CMPL_EVT,
-#endif
 
   /* not handled by execute state machine */
   BTA_HH_API_ENABLE_EVT,
@@ -80,14 +76,10 @@ enum {
   BTA_HH_NULL_ST,
   BTA_HH_IDLE_ST,
   BTA_HH_W4_CONN_ST,
-  BTA_HH_CONN_ST
-#if (BTA_HH_LE_INCLUDED == TRUE)
-  ,
-  BTA_HH_W4_SEC
-#endif
-  ,
+  BTA_HH_CONN_ST,
+  BTA_HH_W4_SEC,
   BTA_HH_INVALID_ST /* Used to check invalid states before executing SM function
-                       */
+                     */
 
 };
 typedef uint8_t tBTA_HH_STATE;
@@ -98,9 +90,7 @@ typedef struct {
   uint8_t t_type;
   uint8_t param;
   uint8_t rpt_id;
-#if (BTA_HH_LE_INCLUDED == TRUE)
   uint8_t srvc_id;
-#endif
   uint16_t data;
   BT_HDR* p_data;
 } tBTA_HH_CMD_DATA;
@@ -136,7 +126,6 @@ typedef struct {
   tBTA_HH_DEV_DSCP_INFO dscp_info;
 } tBTA_HH_MAINT_DEV;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 typedef struct {
   BT_HDR hdr;
   uint16_t conn_id;
@@ -150,7 +139,7 @@ typedef struct {
   uint16_t scan_int;
   uint16_t scan_win;
 } tBTA_HH_SCPP_UPDATE;
-#endif
+
 /* union of all event data types */
 typedef union {
   BT_HDR hdr;
@@ -160,15 +149,12 @@ typedef union {
   tBTA_HH_CBACK_DATA hid_cback;
   tBTA_HH_STATUS status;
   tBTA_HH_MAINT_DEV api_maintdev;
-#if (BTA_HH_LE_INCLUDED == TRUE)
   tBTA_HH_LE_CLOSE le_close;
   tBTA_GATTC_OPEN le_open;
   tBTA_HH_SCPP_UPDATE le_scpp_update;
   tBTA_GATTC_ENC_CMPL_CB le_enc_cmpl;
-#endif
 } tBTA_HH_DATA;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 typedef struct {
   uint8_t index;
   bool in_use;
@@ -210,7 +196,6 @@ typedef struct {
 /* check to see if th edevice handle is a LE device handle */
 #define BTA_HH_IS_LE_DEV_HDL(x) ((x)&0xf0)
 #define BTA_HH_IS_LE_DEV_HDL_VALID(x) (((x) >> 4) <= BTA_HH_LE_MAX_KNOWN)
-#endif
 
 /* device control block */
 typedef struct {
@@ -233,7 +218,6 @@ typedef struct {
   tBTA_HH_PROTO_MODE mode; /* protocol mode */
   tBTA_HH_STATE state;     /* CB state */
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #define BTA_HH_LE_DISC_NONE 0x00
 #define BTA_HH_LE_DISC_HIDS 0x01
 #define BTA_HH_LE_DISC_DIS 0x02
@@ -254,7 +238,6 @@ typedef struct {
 #define BTA_HH_LE_SCPS_NOTIFY_SPT 0x01
 #define BTA_HH_LE_SCPS_NOTIFY_ENB 0x02
   uint8_t scps_notify; /* scan refresh supported/notification enabled */
-#endif
 
   bool security_pending;
 } tBTA_HH_DEV_CB;
@@ -280,11 +263,9 @@ typedef struct {
                                                  block idx, used in sdp */
   uint8_t cb_index[BTA_HH_MAX_KNOWN];     /* maintain a CB index
                                         map to dev handle */
-#if (BTA_HH_LE_INCLUDED == TRUE)
   uint8_t le_cb_index[BTA_HH_LE_MAX_KNOWN]; /* maintain a CB index map to LE dev
                                              handle */
   tGATT_IF gatt_if;
-#endif
   tBTA_HH_CBACK* p_cback; /* Application callbacks */
   tSDP_DISCOVERY_DB* p_disc_db;
   uint8_t trace_level; /* tracing level */
index 15d21f9..be2f2de 100755 (executable)
@@ -22,8 +22,6 @@
 #include "bta_hh_int.h"
 #include "osi/include/osi.h"
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
-
 #include <string.h>
 
 #include <base/bind.h>
@@ -2127,5 +2125,3 @@ static void bta_hh_process_cache_rpt(tBTA_HH_DEV_CB* p_cb,
     }
   }
 }
-
-#endif
index 2528391..5de1b80 100644 (file)
@@ -51,14 +51,12 @@ enum {
   BTA_HH_MAINT_DEV_ACT,
   BTA_HH_OPEN_CMPL_ACT,
   BTA_HH_OPEN_FAILURE,
-#if (BTA_HH_LE_INCLUDED == TRUE)
   BTA_HH_GATT_CLOSE,
   BTA_HH_LE_OPEN_FAIL,
   BTA_HH_GATT_OPEN,
   BTA_HH_START_SEC,
   BTA_HH_SEC_CMPL,
   BTA_HH_GATT_ENC_CMPL,
-#endif
   BTA_HH_NUM_ACTIONS
 };
 
@@ -69,16 +67,13 @@ typedef void (*tBTA_HH_ACTION)(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
 
 /* action functions */
 const tBTA_HH_ACTION bta_hh_action[] = {
-    bta_hh_api_disc_act, bta_hh_open_act, bta_hh_close_act, bta_hh_data_act,
-    bta_hh_ctrl_dat_act, bta_hh_handsk_act, bta_hh_start_sdp, bta_hh_sdp_cmpl,
-    bta_hh_write_dev_act, bta_hh_get_dscp_act, bta_hh_maint_dev_act,
-    bta_hh_open_cmpl_act, bta_hh_open_failure
-#if (BTA_HH_LE_INCLUDED == TRUE)
-    ,
-    bta_hh_gatt_close, bta_hh_le_open_fail, bta_hh_gatt_open,
-    bta_hh_start_security, bta_hh_security_cmpl, bta_hh_le_notify_enc_cmpl
-#endif
-};
+    bta_hh_api_disc_act,      bta_hh_open_act,       bta_hh_close_act,
+    bta_hh_data_act,          bta_hh_ctrl_dat_act,   bta_hh_handsk_act,
+    bta_hh_start_sdp,         bta_hh_sdp_cmpl,       bta_hh_write_dev_act,
+    bta_hh_get_dscp_act,      bta_hh_maint_dev_act,  bta_hh_open_cmpl_act,
+    bta_hh_open_failure,      bta_hh_gatt_close,     bta_hh_le_open_fail,
+    bta_hh_gatt_open,         bta_hh_start_security, bta_hh_security_cmpl,
+    bta_hh_le_notify_enc_cmpl};
 
 /* state table information */
 #define BTA_HH_ACTION 0     /* position of action */
@@ -100,7 +95,6 @@ const uint8_t bta_hh_st_idle[][BTA_HH_NUM_COLS] = {
     /* BTA_HH_API_GET_DSCP_EVT  */ {BTA_HH_IGNORE, BTA_HH_IDLE_ST},
     /* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_IDLE_ST},
     /* BTA_HH_OPEN_CMPL_EVT        */ {BTA_HH_OPEN_CMPL_ACT, BTA_HH_CONN_ST}
-#if (BTA_HH_LE_INCLUDED == TRUE)
     /* BTA_HH_GATT_CLOSE_EVT    */,
     {BTA_HH_IGNORE, BTA_HH_IDLE_ST}
     /* BTA_HH_GATT_OPEN_EVT    */,
@@ -111,8 +105,6 @@ const uint8_t bta_hh_st_idle[][BTA_HH_NUM_COLS] = {
     {BTA_HH_IGNORE, BTA_HH_IDLE_ST}
     /* BTA_HH_GATT_ENC_CMPL_EVT */,
     {BTA_HH_IGNORE, BTA_HH_IDLE_ST}
-#endif
-
 };
 
 const uint8_t bta_hh_st_w4_conn[][BTA_HH_NUM_COLS] = {
@@ -129,7 +121,6 @@ const uint8_t bta_hh_st_w4_conn[][BTA_HH_NUM_COLS] = {
     /* BTA_HH_API_GET_DSCP_EVT  */ {BTA_HH_IGNORE, BTA_HH_W4_CONN_ST},
     /* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_IDLE_ST},
     /* BTA_HH_OPEN_CMPL_EVT     */ {BTA_HH_OPEN_CMPL_ACT, BTA_HH_CONN_ST}
-#if (BTA_HH_LE_INCLUDED == TRUE)
     /* BTA_HH_GATT_CLOSE_EVT    */,
     {BTA_HH_LE_OPEN_FAIL, BTA_HH_IDLE_ST}
     /* BTA_HH_GATT_OPEN_EVT    */,
@@ -140,7 +131,6 @@ const uint8_t bta_hh_st_w4_conn[][BTA_HH_NUM_COLS] = {
     {BTA_HH_IGNORE, BTA_HH_W4_CONN_ST}
     /* BTA_HH_GATT_ENC_CMPL_EVT */,
     {BTA_HH_IGNORE, BTA_HH_W4_CONN_ST}
-#endif
 };
 
 const uint8_t bta_hh_st_connected[][BTA_HH_NUM_COLS] = {
@@ -157,7 +147,6 @@ const uint8_t bta_hh_st_connected[][BTA_HH_NUM_COLS] = {
     /* BTA_HH_API_GET_DSCP_EVT  */ {BTA_HH_GET_DSCP_ACT, BTA_HH_CONN_ST},
     /* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_CONN_ST},
     /* BTA_HH_OPEN_CMPL_EVT        */ {BTA_HH_IGNORE, BTA_HH_CONN_ST}
-#if (BTA_HH_LE_INCLUDED == TRUE)
     /* BTA_HH_GATT_CLOSE_EVT    */,
     {BTA_HH_GATT_CLOSE, BTA_HH_IDLE_ST}
     /* BTA_HH_GATT_OPEN_EVT    */,
@@ -168,9 +157,8 @@ const uint8_t bta_hh_st_connected[][BTA_HH_NUM_COLS] = {
     {BTA_HH_IGNORE, BTA_HH_CONN_ST}
     /* BTA_HH_GATT_ENC_CMPL_EVT */,
     {BTA_HH_IGNORE, BTA_HH_CONN_ST}
-#endif
 };
-#if (BTA_HH_LE_INCLUDED == TRUE)
+
 const uint8_t bta_hh_st_w4_sec[][BTA_HH_NUM_COLS] = {
     /* Event                          Action                 Next state */
     /* BTA_HH_API_OPEN_EVT      */ {BTA_HH_IGNORE, BTA_HH_W4_SEC},
@@ -190,19 +178,13 @@ const uint8_t bta_hh_st_w4_sec[][BTA_HH_NUM_COLS] = {
     /* BTA_HH_START_ENC_EVT    */ {BTA_HH_IGNORE, BTA_HH_W4_SEC},
     /* BTA_HH_ENC_CMPL_EVT     */ {BTA_HH_SEC_CMPL, BTA_HH_W4_CONN_ST},
     /* BTA_HH_GATT_ENC_CMPL_EVT */ {BTA_HH_GATT_ENC_CMPL, BTA_HH_W4_SEC}};
-#endif
 
 /* type for state table */
 typedef const uint8_t (*tBTA_HH_ST_TBL)[BTA_HH_NUM_COLS];
 
 /* state table */
 const tBTA_HH_ST_TBL bta_hh_st_tbl[] = {bta_hh_st_idle, bta_hh_st_w4_conn,
-                                        bta_hh_st_connected
-#if (BTA_HH_LE_INCLUDED == TRUE)
-                                        ,
-                                        bta_hh_st_w4_sec
-#endif
-};
+                                        bta_hh_st_connected, bta_hh_st_w4_sec};
 
 /*****************************************************************************
  * Global data
@@ -465,7 +447,6 @@ static const char* bta_hh_evt_code(tBTA_HH_INT_EVT evt_code) {
       return "BTA_HH_API_GET_DSCP_EVT";
     case BTA_HH_OPEN_CMPL_EVT:
       return "BTA_HH_OPEN_CMPL_EVT";
-#if (BTA_HH_LE_INCLUDED == TRUE)
     case BTA_HH_GATT_CLOSE_EVT:
       return "BTA_HH_GATT_CLOSE_EVT";
     case BTA_HH_GATT_OPEN_EVT:
@@ -474,7 +455,6 @@ static const char* bta_hh_evt_code(tBTA_HH_INT_EVT evt_code) {
       return "BTA_HH_START_ENC_EVT";
     case BTA_HH_ENC_CMPL_EVT:
       return "BTA_HH_ENC_CMPL_EVT";
-#endif
     default:
       return "unknown HID Host event code";
   }
@@ -499,10 +479,8 @@ static const char* bta_hh_state_code(tBTA_HH_STATE state_code) {
       return "BTA_HH_W4_CONN_ST";
     case BTA_HH_CONN_ST:
       return "BTA_HH_CONN_ST";
-#if (BTA_HH_LE_INCLUDED == TRUE)
     case BTA_HH_W4_SEC:
       return "BTA_HH_W4_SEC";
-#endif
     default:
       return "unknown HID Host state";
   }
index 8931caf..eb4ac5a 100644 (file)
@@ -110,12 +110,10 @@ void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb) {
   uint8_t index;
 
   if (p_cb->hid_handle != BTA_HH_INVALID_HANDLE) {
-#if (BTA_HH_LE_INCLUDED == TRUE)
     if (p_cb->is_le_device)
       bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] =
           BTA_HH_IDX_INVALID;
     else
-#endif
       bta_hh_cb.cb_index[p_cb->hid_handle] = BTA_HH_IDX_INVALID;
   }
 
@@ -142,11 +140,7 @@ void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb) {
  ******************************************************************************/
 void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
                            uint16_t product_id, uint16_t version,
-#if (BTA_HH_LE_INCLUDED == TRUE)
                            uint8_t flag)
-#else
-                           UNUSED_ATTR uint8_t flag)
-#endif
 {
 #if (BTA_HH_DEBUG == TRUE)
   APPL_TRACE_DEBUG("vendor_id = 0x%2x product_id = 0x%2x version = 0x%2x",
@@ -155,9 +149,7 @@ void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
   p_cb->dscp_info.vendor_id = vendor_id;
   p_cb->dscp_info.product_id = product_id;
   p_cb->dscp_info.version = version;
-#if (BTA_HH_LE_INCLUDED == TRUE)
   p_cb->dscp_info.flag = flag;
-#endif
 }
 /*******************************************************************************
  *
@@ -472,7 +464,6 @@ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) {
 uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) {
   uint8_t index = BTA_HH_IDX_INVALID;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
   if (BTA_HH_IS_LE_DEV_HDL(dev_handle)) {
     if (BTA_HH_IS_LE_DEV_HDL_VALID(dev_handle))
       index = bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(dev_handle)];
@@ -481,7 +472,6 @@ uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) {
                      dev_handle, index);
 #endif
   } else
-#endif
       /* regular HID device checking */
       if (dev_handle < BTA_HH_MAX_KNOWN)
     index = bta_hh_cb.cb_index[dev_handle];
index f14dbdd..198e9ce 100644 (file)
@@ -21,9 +21,7 @@
 #include "bta_api.h"
 #include "hidh_api.h"
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #include "gatt_api.h"
-#endif
 
 /*****************************************************************************
  *  Constants and Type Definitions
@@ -77,7 +75,6 @@ typedef uint16_t tBTA_HH_EVT;
 #define BTA_HH_IDX_INVALID 0xff
 #define BTA_HH_MAX_KNOWN HID_HOST_MAX_DEVICES
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 /* GATT_MAX_PHY_CHANNEL can not exceed 14 for the design of BTA HH */
 #if GATT_MAX_PHY_CHANNEL > 14
 #define BTA_HH_LE_MAX_KNOWN 14
@@ -86,9 +83,6 @@ typedef uint16_t tBTA_HH_EVT;
 #endif
 
 #define BTA_HH_MAX_DEVICE (HID_HOST_MAX_DEVICES + BTA_HH_LE_MAX_KNOWN)
-#else
-#define BTA_HH_MAX_DEVICE HID_HOST_MAX_DEVICES
-#endif
 /* invalid device handle */
 #define BTA_HH_INVALID_HANDLE 0xff
 
@@ -190,12 +184,10 @@ typedef struct {
   uint16_t
       ssr_min_tout;  /* SSR min timeout, BTA_HH_SSR_PARAM_INVALID if unknown */
   uint8_t ctry_code; /*Country Code.*/
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #define BTA_HH_LE_REMOTE_WAKE 0x01
 #define BTA_HH_LE_NORMAL_CONN 0x02
 
   uint8_t flag;
-#endif
   tBTA_HH_DEV_DESCR descriptor;
 } tBTA_HH_DEV_DSCP_INFO;
 
@@ -204,10 +196,8 @@ typedef struct {
   RawAddress bda;        /* HID device bd address    */
   tBTA_HH_STATUS status; /* operation status         */
   uint8_t handle;        /* device handle            */
-#if (BTA_HH_LE_INCLUDED == TRUE)
   bool le_hid;         /* is LE devices? */
   bool scps_supported; /* scan parameter service supported */
-#endif
 
 } tBTA_HH_CONN;
 
index d3362ad..54877e5 100644 (file)
@@ -102,7 +102,6 @@ extern void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status);
 extern void bta_hh_co_get_rpt_rsp(uint8_t dev_handle, uint8_t status,
                                   uint8_t* p_rpt, uint16_t len);
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 /*******************************************************************************
  *
  * Function         bta_hh_le_co_rpt_info
@@ -156,6 +155,4 @@ extern tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(
 extern void bta_hh_le_co_reset_rpt_cache(const RawAddress& remote_bda,
                                          uint8_t app_id);
 
-#endif /* #if (BTA_HH_LE_INCLUDED == TRUE) */
-
 #endif /* BTA_HH_CO_H */
index cec3f69..2c7232f 100644 (file)
 
 const char* dev_path = "/dev/uhid";
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 #include "btif_config.h"
 #define BTA_HH_NV_LOAD_MAX 16
 static tBTA_HH_RPT_CACHE_ENTRY sReportCache[BTA_HH_NV_LOAD_MAX];
-#endif
 #define GET_RPT_RSP_OFFSET 9
 #define THREAD_NORMAL_PRIORITY 0
 #define BT_HH_THREAD "bt_hh_thread"
@@ -614,7 +612,6 @@ void bta_hh_co_get_rpt_rsp(uint8_t dev_handle, uint8_t status, uint8_t* p_rpt,
   }
 }
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
 /*******************************************************************************
  *
  * Function         bta_hh_le_co_rpt_info
@@ -709,5 +706,3 @@ void bta_hh_le_co_reset_rpt_cache(const RawAddress& remote_bda,
 
   BTIF_TRACE_DEBUG("%s() - Reset cache for bda %s", __func__, bdstr);
 }
-
-#endif  // (BTA_HH_LE_INCLUDED == TRUE)
index 92e894a..6c86f7d 100644 (file)
 #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
 #endif
 
-#ifndef BTA_HH_LE_INCLUDED
-#define BTA_HH_LE_INCLUDED TRUE
-#endif
-
 #ifndef BTA_AV_SINK_INCLUDED
 #define BTA_AV_SINK_INCLUDED FALSE
 #endif