Skip to content

Commit a3cc3eb

Browse files
committed
512 is max length for variable length, not fixed
1 parent 96774b1 commit a3cc3eb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

adafruit_ble/characteristics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Characteristic:
5151
:param int write_perm: Specifies whether the characteristic can be written by a client,
5252
and if so, which security mode is required. Values allowed are the same as ``read_perm``.
5353
:param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed
54-
is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
54+
is 512, or on nRF, 510 if ``fixed_length`` is True. The default, 20, is the maximum
5555
number of data bytes that fit in a single BLE 4.x ATT packet.
5656
:param bool fixed_length: True if the characteristic value is of fixed length.
5757
:param buf initial_value: The initial value for this characteristic. If not given, will be

adafruit_ble/characteristics/string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
properties=properties,
5252
read_perm=read_perm,
5353
write_perm=write_perm,
54-
max_length=510, # shorter than 512 due to fixed_length==False
54+
max_length=512,
5555
fixed_length=False,
5656
initial_value=initial_value,
5757
)

0 commit comments

Comments
 (0)