mirror of
https://github.com/google/bumble.git
synced 2026-05-10 04:18:03 +00:00
add basic support for mypy type checking
This commit is contained in:
@@ -15,11 +15,13 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Imports
|
||||
# -----------------------------------------------------------------------------
|
||||
from __future__ import annotations
|
||||
import struct
|
||||
import collections
|
||||
import logging
|
||||
import functools
|
||||
from colors import color
|
||||
from typing import Dict, Type
|
||||
|
||||
from .core import (
|
||||
BT_BR_EDR_TRANSPORT,
|
||||
@@ -1690,6 +1692,11 @@ class Address:
|
||||
RANDOM_IDENTITY_ADDRESS: 'RANDOM_IDENTITY_ADDRESS',
|
||||
}
|
||||
|
||||
# Type declarations
|
||||
NIL: Address
|
||||
ANY: Address
|
||||
ANY_RANDOM: Address
|
||||
|
||||
# pylint: disable-next=unnecessary-lambda
|
||||
ADDRESS_TYPE_SPEC = {'size': 1, 'mapper': lambda x: Address.address_type_name(x)}
|
||||
|
||||
@@ -1874,7 +1881,7 @@ class HCI_Command(HCI_Packet):
|
||||
'''
|
||||
|
||||
hci_packet_type = HCI_COMMAND_PACKET
|
||||
command_classes = {}
|
||||
command_classes: Dict[int, Type[HCI_Command]] = {}
|
||||
|
||||
@staticmethod
|
||||
def command(fields=(), return_parameters_fields=()):
|
||||
@@ -4020,8 +4027,8 @@ class HCI_Event(HCI_Packet):
|
||||
'''
|
||||
|
||||
hci_packet_type = HCI_EVENT_PACKET
|
||||
event_classes = {}
|
||||
meta_event_classes = {}
|
||||
event_classes: Dict[int, Type[HCI_Event]] = {}
|
||||
meta_event_classes: Dict[int, Type[HCI_LE_Meta_Event]] = {}
|
||||
|
||||
@staticmethod
|
||||
def event(fields=()):
|
||||
|
||||
Reference in New Issue
Block a user