Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffb11725 authored by Zach Johnson's avatar Zach Johnson
Browse files

Stop the redefinition madness

why, just why

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0c4494729871fe8f5455b504d09ee1a1b8d73a95
parent 23f3724d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -84,12 +84,12 @@ void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode) {
 * Returns          void
 *
 ******************************************************************************/
void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_DM_SEARCH_CBACK* p_cback) {
void BTA_DmSearch(tBTM_INQ_PARMS* p_dm_inq, tBTA_DM_SEARCH_CBACK* p_cback) {
  tBTA_DM_API_SEARCH* p_msg =
      (tBTA_DM_API_SEARCH*)osi_calloc(sizeof(tBTA_DM_API_SEARCH));

  p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
  memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTA_DM_INQ));
  memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTM_INQ_PARMS));
  p_msg->p_cback = p_cback;

  bta_sys_sendmsg(p_msg);
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ enum {
/* data type for BTA_DM_API_SEARCH_EVT */
typedef struct {
  BT_HDR hdr;
  tBTA_DM_INQ inq_params;
  tBTM_INQ_PARMS inq_params;
  tBTA_SERVICE_MASK services;
  tBTA_DM_SEARCH_CBACK* p_cback;
} tBTA_DM_API_SEARCH;
+2 −65
Original line number Diff line number Diff line
@@ -186,45 +186,6 @@ typedef uint16_t

typedef uint16_t tBTA_DM_CONN;

/* Pairable Modes */
#define BTA_DM_PAIRABLE 1
#define BTA_DM_NON_PAIRABLE 0

/* Connectable Paired Only Mode */
#define BTA_DM_CONN_ALL 0
#define BTA_DM_CONN_PAIRED 1

/* Inquiry Modes */
#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
#define BTA_DM_GENERAL_INQUIRY \
  BTM_GENERAL_INQUIRY /* Perform general inquiry. */
#define BTA_DM_LIMITED_INQUIRY \
  BTM_LIMITED_INQUIRY /* Perform limited inquiry. */

#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
#define BTA_BLE_GENERAL_INQUIRY \
  BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
#define BTA_BLE_LIMITED_INQUIRY \
  BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
typedef uint8_t tBTA_DM_INQ_MODE;

/* Inquiry Filter Type */
#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
#define BTA_DM_INQ_DEV_CLASS \
  BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
#define BTA_DM_INQ_BD_ADDR \
  BTM_FILTER_COND_BD_ADDR /* Filter on a specific  BD address. */

typedef uint8_t tBTA_DM_INQ_FILT;

/* Authorize Response */
#define BTA_DM_AUTH_PERM \
  0 /* Authorized for future connections to the service */
#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
#define BTA_DM_NOT_AUTH 2  /* Not authorized for the service */

typedef uint8_t tBTA_AUTH_RESP;

/* M/S preferred roles */
#define BTA_ANY_ROLE 0x00
#define BTA_MASTER_ROLE_PREF 0x01
@@ -248,31 +209,6 @@ enum {

};

/* Inquiry filter device class condition */
typedef struct {
  DEV_CLASS dev_class;      /* device class of interest */
  DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of
                               interest */
} tBTA_DM_COD_COND;

/* Inquiry Filter Condition */
typedef union {
  RawAddress bd_addr;              /* BD address of  device to filter. */
  tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
} tBTA_DM_INQ_COND;

/* Inquiry Parameters */
typedef struct {
  tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
  uint8_t duration;      /* Inquiry duration in 1.28 sec units. */
  uint8_t max_resps; /* Maximum inquiry responses.  Set to zero for unlimited
                        responses. */
  bool report_dup; /* report duplicated inquiry response with higher RSSI value
                      */
  tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
  tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
} tBTA_DM_INQ;

typedef struct {
  uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is
                                      shortened */
@@ -942,7 +878,8 @@ extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode);
 * Returns          void
 *
 ******************************************************************************/
extern void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_DM_SEARCH_CBACK* p_cback);
extern void BTA_DmSearch(tBTM_INQ_PARMS* p_dm_inq,
                         tBTA_DM_SEARCH_CBACK* p_cback);

/*******************************************************************************
 *
+3 −3
Original line number Diff line number Diff line
@@ -1832,7 +1832,7 @@ static void bte_scan_filt_param_cfg_evt(uint8_t ref_value, uint8_t avbl_space,
 *
 ******************************************************************************/
void btif_dm_start_discovery(void) {
  tBTA_DM_INQ inq_params;
  tBTM_INQ_PARMS inq_params;

  BTIF_TRACE_EVENT("%s", __func__);

@@ -1855,13 +1855,13 @@ void btif_dm_start_discovery(void) {
  /* TODO: Do we need to handle multiple inquiries at the same time? */

  /* Set inquiry params and call API */
  inq_params.mode = BTA_DM_GENERAL_INQUIRY | BTA_BLE_GENERAL_INQUIRY;
  inq_params.mode = BTM_GENERAL_INQUIRY | BTM_BLE_GENERAL_INQUIRY;
  inq_params.duration = BTIF_DM_DEFAULT_INQ_MAX_DURATION;

  inq_params.max_resps = BTIF_DM_DEFAULT_INQ_MAX_RESULTS;
  inq_params.report_dup = true;

  inq_params.filter_type = BTA_DM_INQ_CLR;
  inq_params.filter_cond_type = BTM_CLR_INQUIRY_FILTER;
  /* TODO: Filter device by BDA needs to be implemented here */

  /* Will be enabled to true once inquiry busy level has been received */