Skip to content

Commit 519dbee

Browse files
author
Kevin J Walters
committed
Changing the attribute data from a dict to an OrderedDict to enhance control over order to increase the utility of prefix matching.
1 parent 41f7a35 commit 519dbee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_ble/advertising/standard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"""
3030

3131
import struct
32+
from collections import OrderedDict
3233

3334
from . import (
3435
Advertisement,
@@ -220,7 +221,7 @@ def __init__(
220221
self._company_id = company_id
221222
self._adt = advertising_data_type
222223

223-
self.data = {}
224+
self.data = OrderedDict() # makes field order match order they are set in
224225
self.company_id = company_id
225226
encoded_company = struct.pack("<H", company_id)
226227
if 0xFF in obj.data_dict:

0 commit comments

Comments
 (0)