diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aed9dec..374676d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v3.3.0 + rev: v3.3.1 hooks: - id: pylint name: pylint (library code) diff --git a/adafruit_ble/characteristics/stream.py b/adafruit_ble/characteristics/stream.py index 5053971..1582e9d 100755 --- a/adafruit_ble/characteristics/stream.py +++ b/adafruit_ble/characteristics/stream.py @@ -66,7 +66,11 @@ def __init__( self._timeout = timeout self._buffer_size = buffer_size super().__init__( - uuid=uuid, properties=properties, read_perm=read_perm, write_perm=write_perm + uuid=uuid, + properties=properties, + read_perm=read_perm, + write_perm=write_perm, + max_length=buffer_size, ) def bind( @@ -104,6 +108,7 @@ def __init__( properties=properties, read_perm=Attribute.NO_ACCESS, write_perm=write_perm, + max_length=buffer_size, ) def bind( diff --git a/adafruit_ble/services/nordic.py b/adafruit_ble/services/nordic.py index d4db39b..f71e761 100755 --- a/adafruit_ble/services/nordic.py +++ b/adafruit_ble/services/nordic.py @@ -43,12 +43,14 @@ class UARTService(Service): _server_tx = StreamOut( uuid=VendorUUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E"), timeout=1.0, - buffer_size=64, + # 512 is the largest negotiated MTU-3 value for all CircuitPython ports. + buffer_size=512, ) _server_rx = StreamIn( uuid=VendorUUID("6E400002-B5A3-F393-E0A9-E50E24DCCA9E"), timeout=1.0, - buffer_size=64, + # 512 is the largest negotiated MTU-3 value for all CircuitPython ports. + buffer_size=512, ) def __init__(self, service: Optional[_bleio.Service] = None) -> None: