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
}
bool bluetooth::shim::L2CA_SetAclPriority(const RawAddress& bd_addr,
- uint8_t priority) {
+ tL2CAP_PRIORITY priority) {
LOG_INFO("UNIMPLEMENTED %s", __func__);
return false;
}
* 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);
/*******************************************************************************
*
#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
* 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);
/*******************************************************************************
*
* 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);
}
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];
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);
*
******************************************************************************/
-bool l2cu_set_acl_priority(const RawAddress& bd_addr, uint8_t priority,
+bool l2cu_set_acl_priority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority,
bool reset_after_rs) {
tL2C_LCB* p_lcb;
uint8_t* pp;