From 8d2f37aa7a265b28b4970998489d3c1ac02ecaee Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Wed, 17 Jan 2024 21:17:13 -0800 Subject: [PATCH] inclusive language --- bumble/device.py | 4 ++-- bumble/gatt_client.py | 2 +- bumble/gatt_server.py | 2 +- bumble/hci.py | 2 +- bumble/l2cap.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bumble/device.py b/bumble/device.py index fb5f7258..46ddc48e 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -604,13 +604,13 @@ def __post_init__(self) -> None: async def set_advertising_parameters( self, advertising_parameters: AdvertisingParameters ) -> None: - # Sanity check + # Compliance check if ( not advertising_parameters.advertising_event_properties.is_legacy and advertising_parameters.advertising_event_properties.is_connectable and advertising_parameters.advertising_event_properties.is_scannable ): - raise ValueError( + logger.warning( "non-legacy extended advertising event properties may not be both " "connectable and scannable" ) diff --git a/bumble/gatt_client.py b/bumble/gatt_client.py index d5a8ec7c..2079a658 100644 --- a/bumble/gatt_client.py +++ b/bumble/gatt_client.py @@ -1068,7 +1068,7 @@ def on_gatt_pdu(self, att_pdu: ATT_PDU) -> None: logger.warning('!!! unexpected response, there is no pending request') return - # Sanity check: the response should match the pending request unless it is + # The response should match the pending request unless it is # an error response if att_pdu.op_code != ATT_ERROR_RESPONSE: expected_response_name = self.pending_request.name.replace( diff --git a/bumble/gatt_server.py b/bumble/gatt_server.py index d574d520..3be41851 100644 --- a/bumble/gatt_server.py +++ b/bumble/gatt_server.py @@ -328,7 +328,7 @@ def write_cccd( f'handle=0x{characteristic.handle:04X}: {value.hex()}' ) - # Sanity check + # Check parameters if len(value) != 2: logger.warning('CCCD value not 2 bytes long') return diff --git a/bumble/hci.py b/bumble/hci.py index d26aa16f..5d22ea07 100644 --- a/bumble/hci.py +++ b/bumble/hci.py @@ -6371,7 +6371,7 @@ def feed_packet(self, packet: HCI_AclDataPacket) -> None: self.current_data = None self.l2cap_pdu_length = 0 else: - # Sanity check + # Compliance check if len(self.current_data) > self.l2cap_pdu_length + 4: logger.warning('!!! ACL data exceeds L2CAP PDU') self.current_data = None diff --git a/bumble/l2cap.py b/bumble/l2cap.py index c1fbdf62..f91a269f 100644 --- a/bumble/l2cap.py +++ b/bumble/l2cap.py @@ -208,7 +208,7 @@ class L2CAP_PDU: @staticmethod def from_bytes(data: bytes) -> L2CAP_PDU: - # Sanity check + # Check parameters if len(data) < 4: raise ValueError('not enough data for L2CAP header')