Skip to content

Make DeviceInfoService handle remote services #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions adafruit_ble/services/standard/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,32 @@
class DeviceInfoService(Service):
"""Device information"""
uuid = StandardUUID(0x180a)
default_field_name = "device_info"
model_number = FixedStringCharacteristic(uuid=StandardUUID(0x2a24))
serial_number = FixedStringCharacteristic(uuid=StandardUUID(0x2a25))
firmware_revision = FixedStringCharacteristic(uuid=StandardUUID(0x2a26))
hardware_revision = FixedStringCharacteristic(uuid=StandardUUID(0x2a27))
software_revision = FixedStringCharacteristic(uuid=StandardUUID(0x2a28))
manufacturer = FixedStringCharacteristic(uuid=StandardUUID(0x2a29))

def __init__(self, *, manufacturer,
software_revision,
def __init__(self, *,
manufacturer=None,
software_revision=None,
model_number=None,
serial_number=None,
firmware_revision=None,
hardware_revision=None):
if model_number is None:
model_number = sys.platform
if serial_number is None:
serial_number = binascii.hexlify(microcontroller.cpu.uid).decode('utf-8') # pylint: disable=no-member

if firmware_revision is None:
firmware_revision = os.uname().version
hardware_revision=None,
service=None):
if not service:
if model_number is None:
model_number = sys.platform
if serial_number is None:
serial_number = binascii.hexlify(microcontroller.cpu.uid).decode('utf-8') # pylint: disable=no-member
if firmware_revision is None:
firmware_revision = os.uname().version
super().__init__(manufacturer=manufacturer,
software_revision=software_revision,
model_number=model_number,
serial_number=serial_number,
firmware_revision=firmware_revision,
hardware_revision=hardware_revision)
hardware_revision=hardware_revision,
service=service)