Loading system/stack/eatt/eatt_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,7 @@ struct eatt_impl { .mtu = eatt_dev->rx_mtu_, .mps = eatt_dev->rx_mps_, .credits = L2CAP_LE_CREDIT_DEFAULT, .number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS, }; /* Warning! CIDs in Android are unique across the ACL connections */ Loading system/stack/include/l2c_api.h +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,9 @@ constexpr uint16_t L2CAP_LE_CREDIT_THRESHOLD = 0x0040; static_assert(L2CAP_LE_CREDIT_THRESHOLD < L2CAP_LE_CREDIT_DEFAULT, "Threshold must be smaller than default credits"); // Max number of CIDs in the L2CAP CREDIT BASED CONNECTION REQUEST constexpr uint16_t L2CAP_CREDIT_BASED_MAX_CIDS = 5; /* Define a structure to hold the configuration parameter for LE L2CAP * connection oriented channels. */ Loading @@ -189,6 +192,7 @@ struct tL2CAP_LE_CFG_INFO { uint16_t mtu = 100; uint16_t mps = 100; uint16_t credits = L2CAP_LE_CREDIT_DEFAULT; uint8_t number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS; }; /********************************* Loading system/stack/l2cap/l2c_api.cc +7 −1 Original line number Diff line number Diff line Loading @@ -782,7 +782,13 @@ std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, tL2C_CCB* p_ccb_primary; for (int i = 0; i < 5; i++) { /* Make sure user set proper value for number of cids */ if (p_cfg->number_of_channels > L2CAP_CREDIT_BASED_MAX_CIDS || p_cfg->number_of_channels == 0) { p_cfg->number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS; } for (int i = 0; i < p_cfg->number_of_channels; i++) { /* Allocate a channel control block */ tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); if (p_ccb == NULL) { Loading system/stack/l2cap/l2c_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -397,8 +397,6 @@ typedef struct { #define L2CAP_GET_PRIORITY_QUOTA(pri) \ ((L2CAP_NUM_CHNL_PRIORITY - (pri)) * L2CAP_CHNL_PRIORITY_WEIGHT) #define L2CAP_CREDIT_BASED_MAX_CIDS 5 /* CCBs within the same LCB are served in round robin with priority It will make * sure that low priority channel (for example, HF signaling on RFCOMM) can be * sent to the headset even if higher priority channel (for example, AV media Loading Loading
system/stack/eatt/eatt_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,7 @@ struct eatt_impl { .mtu = eatt_dev->rx_mtu_, .mps = eatt_dev->rx_mps_, .credits = L2CAP_LE_CREDIT_DEFAULT, .number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS, }; /* Warning! CIDs in Android are unique across the ACL connections */ Loading
system/stack/include/l2c_api.h +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,9 @@ constexpr uint16_t L2CAP_LE_CREDIT_THRESHOLD = 0x0040; static_assert(L2CAP_LE_CREDIT_THRESHOLD < L2CAP_LE_CREDIT_DEFAULT, "Threshold must be smaller than default credits"); // Max number of CIDs in the L2CAP CREDIT BASED CONNECTION REQUEST constexpr uint16_t L2CAP_CREDIT_BASED_MAX_CIDS = 5; /* Define a structure to hold the configuration parameter for LE L2CAP * connection oriented channels. */ Loading @@ -189,6 +192,7 @@ struct tL2CAP_LE_CFG_INFO { uint16_t mtu = 100; uint16_t mps = 100; uint16_t credits = L2CAP_LE_CREDIT_DEFAULT; uint8_t number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS; }; /********************************* Loading
system/stack/l2cap/l2c_api.cc +7 −1 Original line number Diff line number Diff line Loading @@ -782,7 +782,13 @@ std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, tL2C_CCB* p_ccb_primary; for (int i = 0; i < 5; i++) { /* Make sure user set proper value for number of cids */ if (p_cfg->number_of_channels > L2CAP_CREDIT_BASED_MAX_CIDS || p_cfg->number_of_channels == 0) { p_cfg->number_of_channels = L2CAP_CREDIT_BASED_MAX_CIDS; } for (int i = 0; i < p_cfg->number_of_channels; i++) { /* Allocate a channel control block */ tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); if (p_ccb == NULL) { Loading
system/stack/l2cap/l2c_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -397,8 +397,6 @@ typedef struct { #define L2CAP_GET_PRIORITY_QUOTA(pri) \ ((L2CAP_NUM_CHNL_PRIORITY - (pri)) * L2CAP_CHNL_PRIORITY_WEIGHT) #define L2CAP_CREDIT_BASED_MAX_CIDS 5 /* CCBs within the same LCB are served in round robin with priority It will make * sure that low priority channel (for example, HF signaling on RFCOMM) can be * sent to the headset even if higher priority channel (for example, AV media Loading