From 352899a8b3d7310ce5c13d8c95feac9a5d955951 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Mon, 14 Oct 2024 23:06:59 +0900 Subject: [PATCH] Add PNP ID designation to DeviceInfoService --- adafruit_ble/services/standard/device_info.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adafruit_ble/services/standard/device_info.py b/adafruit_ble/services/standard/device_info.py index 0ebd8ac..067046c 100644 --- a/adafruit_ble/services/standard/device_info.py +++ b/adafruit_ble/services/standard/device_info.py @@ -14,9 +14,11 @@ import binascii import os import sys +from collections.abc import Iterable from .. import Service from ...uuid import StandardUUID +from ...characteristics import StructCharacteristic from ...characteristics.string import FixedStringCharacteristic try: @@ -42,6 +44,7 @@ class DeviceInfoService(Service): hardware_revision = FixedStringCharacteristic(uuid=StandardUUID(0x2A27)) software_revision = FixedStringCharacteristic(uuid=StandardUUID(0x2A28)) manufacturer = FixedStringCharacteristic(uuid=StandardUUID(0x2A29)) + pnp_id = StructCharacteristic(' None: if not service: @@ -75,5 +79,6 @@ def __init__( serial_number=serial_number, firmware_revision=firmware_revision, hardware_revision=hardware_revision, + pnp_id=pnp_id, service=service, )