Compare commits

..

2 Commits

Author SHA1 Message Date
uier 8b2bd06393 Force RNT to 0 for unidirectional CIS, keeping PHY valid 2026-07-14 07:51:11 +00:00
TzuWei ab0e5801a2 Revert "CIG: Fix CIG parameters for unidirectional CIS" 2026-07-13 21:15:28 +08:00
2 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -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]
+2 -2
View File
@@ -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)
# -----------------------------------------------------------------------------