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

Commit 0666af01 authored by Chris Manton's avatar Chris Manton
Browse files

bta:: Use proper types tBTA_JV_CONN_TYPE

Bug: 333138448
Test: m .
Flag: EXEMPT, Mechanical Refactor

Change-Id: I5b22e1eeb497a89335868f1b448cea61f3964d98
parent d35df7b6
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -466,7 +466,8 @@ void BTA_JvDisable(void);
 * Returns          void
 *
 ******************************************************************************/
void BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel);
void BTA_JvGetChannelId(tBTA_JV_CONN_TYPE conn_type, uint32_t id,
                        int32_t channel);

/*******************************************************************************
 *
@@ -479,7 +480,7 @@ void BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel);
 *                  BTA_JV_FAILURE, otherwise.
 *
 ******************************************************************************/
tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type);
tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, tBTA_JV_CONN_TYPE conn_type);

/*******************************************************************************
 *
@@ -536,7 +537,8 @@ tBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle);
 *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
 *
 ******************************************************************************/
void BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
void BTA_JvL2capConnect(tBTA_JV_CONN_TYPE conn_type, tBTA_SEC sec_mask,
                        tBTA_JV_ROLE role,
                        std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
                        uint16_t remote_psm, uint16_t rx_mtu,
                        std::unique_ptr<tL2CAP_CFG_INFO> cfg,
@@ -569,7 +571,8 @@ tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
 * Returns          void
 *
 ******************************************************************************/
void BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
void BTA_JvL2capStartServer(tBTA_JV_CONN_TYPE conn_type, tBTA_SEC sec_mask,
                            tBTA_JV_ROLE role,
                            std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
                            uint16_t local_psm, uint16_t rx_mtu,
                            std::unique_ptr<tL2CAP_CFG_INFO> cfg,
+4 −4
Original line number Diff line number Diff line
@@ -714,7 +714,7 @@ static uint16_t bta_jv_allocate_l2cap_classic_psm() {

/** Obtain a free SCN (Server Channel Number) (RFCOMM channel or L2CAP PSM) */
void bta_jv_get_channel_id(
    int32_t type /* One of BTA_JV_CONN_TYPE_ */,
    tBTA_JV_CONN_TYPE type /* One of BTA_JV_CONN_TYPE_ */,
    int32_t channel /* optionally request a specific channel */,
    uint32_t l2cap_socket_id, uint32_t rfcomm_slot_id) {
  uint16_t psm = 0;
@@ -766,7 +766,7 @@ void bta_jv_get_channel_id(
}

/** free a SCN */
void bta_jv_free_scn(int32_t type /* One of BTA_JV_CONN_TYPE_ */,
void bta_jv_free_scn(tBTA_JV_CONN_TYPE type /* One of BTA_JV_CONN_TYPE_ */,
                     uint16_t scn) {
  switch (type) {
    case BTA_JV_CONN_TYPE_RFCOMM:
@@ -1030,7 +1030,7 @@ static void bta_jv_l2cap_client_cback(uint16_t gap_handle, uint16_t event,
}

/* makes an l2cap client connection */
void bta_jv_l2cap_connect(int32_t type, tBTA_SEC sec_mask,
void bta_jv_l2cap_connect(tBTA_JV_CONN_TYPE type, tBTA_SEC sec_mask,
                          tBTA_JV_ROLE /* role */, uint16_t remote_psm,
                          uint16_t rx_mtu, const RawAddress& peer_bd_addr,
                          std::unique_ptr<tL2CAP_CFG_INFO> cfg_param,
@@ -1177,7 +1177,7 @@ static void bta_jv_l2cap_server_cback(uint16_t gap_handle, uint16_t event,
}

/** starts an L2CAP server */
void bta_jv_l2cap_start_server(int32_t type, tBTA_SEC sec_mask,
void bta_jv_l2cap_start_server(tBTA_JV_CONN_TYPE type, tBTA_SEC sec_mask,
                               tBTA_JV_ROLE /* role */, uint16_t local_psm,
                               uint16_t rx_mtu,
                               std::unique_ptr<tL2CAP_CFG_INFO> cfg_param,
+6 −4
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ void BTA_JvDisable(void) {
 *                  If the SCN/PSM reported is 0, that means all resources are
 *                  exhausted.
 * Parameters
 *   conn_type      one of BTA_JV_CONN_TYPE_
 *   conn_type      one of BTA_JV_CONN_TYPE
 *   user_data      Any uservalue - will be returned in the resulting event.
 *   channel        Only used for RFCOMM - to try to allocate a specific RFCOMM
 *                  channel.
@@ -114,7 +114,8 @@ void BTA_JvDisable(void) {
 * Returns          void
 *
 ******************************************************************************/
void BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel) {
void BTA_JvGetChannelId(tBTA_JV_CONN_TYPE conn_type, uint32_t id,
                        int32_t channel) {
  log::verbose("conn_type:{}, id:{}, channel:{}", conn_type, id, channel);

  if (conn_type != BTA_JV_CONN_TYPE_RFCOMM &&
@@ -135,7 +136,7 @@ void BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel) {
 *                  by an application running over RFCOMM.
 * Parameters
 *   channel        The channel to free
 *   conn_type      one of BTA_JV_CONN_TYPE_
 *   conn_type      one of BTA_JV_CONN_TYPE
 *
 * Returns          tBTA_JV_STATUS::SUCCESS, if the request is being processed.
 *                  tBTA_JV_STATUS::FAILURE, otherwise.
@@ -279,7 +280,8 @@ tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle) {
 * Returns          void
 *
 ******************************************************************************/
void BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
void BTA_JvL2capStartServer(tBTA_JV_CONN_TYPE conn_type, tBTA_SEC sec_mask,
                            tBTA_JV_ROLE role,
                            std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
                            uint16_t local_psm, uint16_t rx_mtu,
                            std::unique_ptr<tL2CAP_CFG_INFO> cfg,
+6 −6
Original line number Diff line number Diff line
@@ -145,23 +145,23 @@ extern std::unordered_set<uint16_t> used_l2cap_classic_dynamic_psm;

void bta_jv_enable(tBTA_JV_DM_CBACK* p_cback);
void bta_jv_disable();
void bta_jv_get_channel_id(int32_t type, int32_t channel,
void bta_jv_get_channel_id(tBTA_JV_CONN_TYPE type, int32_t channel,
                           uint32_t l2cap_socket_id, uint32_t rfcomm_slot_id);
void bta_jv_free_scn(int32_t type, uint16_t scn);
void bta_jv_free_scn(tBTA_JV_CONN_TYPE type, uint16_t scn);
void bta_jv_start_discovery(const RawAddress& bd_addr, uint16_t num_uuid,
                            bluetooth::Uuid* uuid_list,
                            uint32_t rfcomm_slot_id);
void bta_jv_create_record(uint32_t rfcomm_slot_id);
void bta_jv_delete_record(uint32_t handle);
void bta_jv_l2cap_connect(int32_t type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
                          uint16_t remote_psm, uint16_t rx_mtu,
                          const RawAddress& peer_bd_addr,
void bta_jv_l2cap_connect(tBTA_JV_CONN_TYPE type, tBTA_SEC sec_mask,
                          tBTA_JV_ROLE role, uint16_t remote_psm,
                          uint16_t rx_mtu, const RawAddress& peer_bd_addr,
                          std::unique_ptr<tL2CAP_CFG_INFO> cfg,
                          std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
                          tBTA_JV_L2CAP_CBACK* p_cback,
                          uint32_t l2cap_socket_id);
void bta_jv_l2cap_close(uint32_t handle, tBTA_JV_L2C_CB* p_cb);
void bta_jv_l2cap_start_server(int32_t type, tBTA_SEC sec_mask,
void bta_jv_l2cap_start_server(tBTA_JV_CONN_TYPE type, tBTA_SEC sec_mask,
                               tBTA_JV_ROLE role, uint16_t local_psm,
                               uint16_t rx_mtu,
                               std::unique_ptr<tL2CAP_CFG_INFO> cfg_param,
+7 −6
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@ tBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK* /* p_cback */) {
  inc_func_call_count(__func__);
  return tBTA_JV_STATUS::SUCCESS;
}
tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t /* channel */, int /* conn_type */) {
tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t /* channel */,
                                 tBTA_JV_CONN_TYPE /* conn_type */) {
  inc_func_call_count(__func__);
  return tBTA_JV_STATUS::SUCCESS;
}
@@ -121,12 +122,12 @@ uint16_t BTA_JvRfcommGetPortHdl(uint32_t /* handle */) {
  return 0;
}
void BTA_JvDisable(void) { inc_func_call_count(__func__); }
void BTA_JvGetChannelId(int /* conn_type */, uint32_t /* id */,
void BTA_JvGetChannelId(tBTA_JV_CONN_TYPE /* conn_type */, uint32_t /* id */,
                        int32_t /* channel */) {
  inc_func_call_count(__func__);
}
void BTA_JvL2capConnect(int /* conn_type */, tBTA_SEC /* sec_mask */,
                        tBTA_JV_ROLE /* role */,
void BTA_JvL2capConnect(tBTA_JV_CONN_TYPE /* conn_type */,
                        tBTA_SEC /* sec_mask */, tBTA_JV_ROLE /* role */,
                        std::unique_ptr<tL2CAP_ERTM_INFO> /* ertm_info */,
                        uint16_t /* remote_psm */, uint16_t /* rx_mtu */,
                        std::unique_ptr<tL2CAP_CFG_INFO> /* cfg */,
@@ -135,8 +136,8 @@ void BTA_JvL2capConnect(int /* conn_type */, tBTA_SEC /* sec_mask */,
                        uint32_t /* l2cap_socket_id */) {
  inc_func_call_count(__func__);
}
void BTA_JvL2capStartServer(int /* conn_type */, tBTA_SEC /* sec_mask */,
                            tBTA_JV_ROLE /* role */,
void BTA_JvL2capStartServer(tBTA_JV_CONN_TYPE /* conn_type */,
                            tBTA_SEC /* sec_mask */, tBTA_JV_ROLE /* role */,
                            std::unique_ptr<tL2CAP_ERTM_INFO> /* ertm_info */,
                            uint16_t /* local_psm */, uint16_t /* rx_mtu */,
                            std::unique_ptr<tL2CAP_CFG_INFO> /* cfg */,