Skip to content

Commit 127e670

Browse files
authored
Merge pull request #6 from tekktrik/feature/use-ble-consts-2
Use newly exposed BLE constants
2 parents 09c74b9 + f3176ec commit 127e670

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

adafruit_ble_creation.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030
ManufacturerData,
3131
ManufacturerDataField,
3232
)
33+
from adafruit_ble.advertising.adafruit import (
34+
MANUFACTURING_DATA_ADT,
35+
ADAFRUIT_COMPANY_ID,
36+
)
3337
from micropython import const
3438

3539
__version__ = "0.0.0-auto.0"
3640
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BLE_Creation.git"
3741

38-
_MANUFACTURING_DATA_ADT = const(0xFF)
39-
_ADAFRUIT_COMPANY_ID = const(0x0822)
4042
# Color packets are 1 (and radio), broadcastnet is 3.
4143
_DEVICE_FRIEND_DATA_ID = const(0x0004)
4244

@@ -49,17 +51,17 @@ class Creation(Advertisement):
4951
match_prefixes = (
5052
struct.pack(
5153
"<BHBH",
52-
_MANUFACTURING_DATA_ADT,
53-
_ADAFRUIT_COMPANY_ID,
54+
MANUFACTURING_DATA_ADT,
55+
ADAFRUIT_COMPANY_ID,
5456
struct.calcsize("<HII"),
5557
_DEVICE_FRIEND_DATA_ID,
5658
),
5759
)
5860
manufacturer_data = LazyObjectField(
5961
ManufacturerData,
6062
"manufacturer_data",
61-
advertising_data_type=_MANUFACTURING_DATA_ADT,
62-
company_id=_ADAFRUIT_COMPANY_ID,
63+
advertising_data_type=MANUFACTURING_DATA_ADT,
64+
company_id=ADAFRUIT_COMPANY_ID,
6365
key_encoding="<H",
6466
)
6567
creation_id = ManufacturerDataField(

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# digitalio, micropython and busio. List the modules you use. Without it, the
2727
# autodoc module docs will fail to generate with a warning.
2828
autodoc_mock_imports = [
29-
"adafruit_ble",
29+
"bleak",
3030
]
3131

3232

0 commit comments

Comments
 (0)