mirror of
https://github.com/google/bumble.git
synced 2026-07-14 14:10:50 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b2bd06393 | |||
| ab0e5801a2 |
+2
-5
@@ -1578,15 +1578,12 @@ class CigParameters:
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
# For unidirectional CIS (e.g., Central-to-Peripheral only), the unused direction's
|
||||
# SDU size is 0. If SDU size is 0, the corresponding retransmission count and PHY
|
||||
# must also be set to 0. Otherwise, some controllers will reject the parameters
|
||||
# with error 0x30 (Parameter Out Of Mandatory Range).
|
||||
# SDU size is 0. If SDU size is 0, we set RTN to 0 as well for maintaining
|
||||
# compatibility with older firmware that has error 0x30 bug.
|
||||
if self.max_sdu_c_to_p == 0:
|
||||
self.rtn_c_to_p = 0
|
||||
self.phy_c_to_p = hci.PhyBit(0)
|
||||
if self.max_sdu_p_to_c == 0:
|
||||
self.rtn_p_to_c = 0
|
||||
self.phy_p_to_c = hci.PhyBit(0)
|
||||
|
||||
cig_id: int
|
||||
cis_parameters: list[CisParameters]
|
||||
|
||||
@@ -604,7 +604,7 @@ def test_cis_parameters_unidirectional():
|
||||
assert cis_c2p.rtn_c_to_p != 0
|
||||
assert cis_c2p.phy_c_to_p != hci.PhyBit(0)
|
||||
assert cis_c2p.rtn_p_to_c == 0
|
||||
assert cis_c2p.phy_p_to_c == hci.PhyBit(0)
|
||||
assert cis_c2p.phy_p_to_c != hci.PhyBit(0)
|
||||
|
||||
# Test P2C unidirectional (C to P not used)
|
||||
cis_p2c = CigParameters.CisParameters(cis_id=2, max_sdu_c_to_p=0)
|
||||
@@ -612,7 +612,7 @@ def test_cis_parameters_unidirectional():
|
||||
assert cis_p2c.rtn_p_to_c != 0
|
||||
assert cis_p2c.phy_p_to_c != hci.PhyBit(0)
|
||||
assert cis_p2c.rtn_c_to_p == 0
|
||||
assert cis_p2c.phy_c_to_p == hci.PhyBit(0)
|
||||
assert cis_p2c.phy_c_to_p != hci.PhyBit(0)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user