We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2505ce2 commit 5b00d8fCopy full SHA for 5b00d8f
adafruit_ble/advertising/standard.py
@@ -215,7 +215,9 @@ class ManufacturerDataField:
215
def __init__(self, key, value_format, field_names=None):
216
self._key = key
217
self._format = value_format
218
- self.element_count = len(value_format.strip("><!=@").replace("x", ""))
+ # TODO: Support format strings that use numbers to repeat a given type. For now, we strip
219
+ # numbers because Radio specifies string length with it.
220
+ self.element_count = len(value_format.strip("><!=@0123456789").replace("x", ""))
221
if self.element_count > 1 and (not field_names or len(field_names) != self.element_count):
222
raise ValueError("Provide field_names when multiple values are in the format")
223
self._entry_length = struct.calcsize(value_format)
0 commit comments