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

Commit db73ab97 authored by Chris Manton's avatar Chris Manton
Browse files

enum-ify stack/include/l2c_api::L2CAP_PRIORITY_

Towards readable code

Bug: 163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink

Change-Id: I6d0f97493f407f1a4e32bc12434ec5c3c3b8ef54
parent a2fff89f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ bool bluetooth::shim::L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr,
}

bool bluetooth::shim::L2CA_SetAclPriority(const RawAddress& bd_addr,
                                          uint8_t priority) {
                                          tL2CAP_PRIORITY priority) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
  return false;
}
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ uint16_t L2CA_FlushChannel(uint16_t lcid, uint16_t num_to_flush);
 * Returns          true if a valid channel, else false
 *
 ******************************************************************************/
bool L2CA_SetAclPriority(const RawAddress& bd_addr, uint8_t priority);
bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority);

/*******************************************************************************
 *
+6 −3
Original line number Diff line number Diff line
@@ -52,8 +52,10 @@
#define L2CAP_DW_CONGESTED 2

/* Values for priority parameter to L2CA_SetAclPriority */
#define L2CAP_PRIORITY_NORMAL 0
#define L2CAP_PRIORITY_HIGH 1
typedef enum : uint8_t {
  L2CAP_PRIORITY_NORMAL = 0,
  L2CAP_PRIORITY_HIGH = 1,
} tL2CAP_PRIORITY;

/* Values for priority parameter to L2CA_SetTxPriority */
#define L2CAP_CHNL_PRIORITY_HIGH 0
@@ -518,7 +520,8 @@ extern uint16_t L2CA_FlushChannel(uint16_t lcid, uint16_t num_to_flush);
 * Returns          true if a valid channel, else false
 *
 ******************************************************************************/
extern bool L2CA_SetAclPriority(const RawAddress& bd_addr, uint8_t priority);
extern bool L2CA_SetAclPriority(const RawAddress& bd_addr,
                                tL2CAP_PRIORITY priority);

/*******************************************************************************
 *
+1 −1
Original line number Diff line number Diff line
@@ -783,7 +783,7 @@ uint8_t L2CA_SetTraceLevel(uint8_t new_level) {
 * Returns          true if a valid channel, else false
 *
 ******************************************************************************/
bool L2CA_SetAclPriority(const RawAddress& bd_addr, uint8_t priority) {
bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
  if (bluetooth::shim::is_gd_shim_enabled()) {
    return bluetooth::shim::L2CA_SetAclPriority(bd_addr, priority);
  }
+3 −2
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ typedef struct t_l2c_linkcb {

  uint8_t peer_chnl_mask[L2CAP_FIXED_CHNL_ARRAY_SIZE];

  uint8_t acl_priority;     /* L2C_PRIORITY_NORMAL or L2C_PRIORITY_HIGH */
  tL2CAP_PRIORITY acl_priority;

  tL2C_CCB* p_fixed_ccbs[L2CAP_NUM_FIXED_CHNLS];

@@ -528,7 +528,8 @@ extern tL2C_LCB* l2cu_find_lcb_by_bd_addr(const RawAddress& p_bd_addr,
                                          tBT_TRANSPORT transport);
extern tL2C_LCB* l2cu_find_lcb_by_handle(uint16_t handle);

extern bool l2cu_set_acl_priority(const RawAddress& bd_addr, uint8_t priority,
extern bool l2cu_set_acl_priority(const RawAddress& bd_addr,
                                  tL2CAP_PRIORITY priority,
                                  bool reset_after_rs);

extern void l2cu_enqueue_ccb(tL2C_CCB* p_ccb);
Loading