diff --git a/bumble/device.py b/bumble/device.py index 7eb5dc15..32b06b8c 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -1578,15 +1578,12 @@ class CisParameters: 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] diff --git a/tests/device_test.py b/tests/device_test.py index 7df82802..fc21bf97 100644 --- a/tests/device_test.py +++ b/tests/device_test.py @@ -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) # -----------------------------------------------------------------------------