123 lines
3.5 KiB
Python
123 lines
3.5 KiB
Python
"""
|
|
This type stub file was generated by pyright.
|
|
"""
|
|
|
|
from . import Advertisement, AdvertisingDataField
|
|
|
|
"""
|
|
:py:mod:`~adafruit_ble.advertising.standard`
|
|
====================================================
|
|
|
|
This module provides BLE standard defined advertisements. The Advertisements are single purpose
|
|
even though multiple purposes may actually be present in a single packet.
|
|
|
|
"""
|
|
__version__ = ...
|
|
__repo__ = ...
|
|
class BoundServiceList:
|
|
"""Sequence-like object of Service UUID objects. It stores both standard and vendor UUIDs."""
|
|
def __init__(self, advertisement, *, standard_services, vendor_services) -> None:
|
|
...
|
|
|
|
def __contains__(self, key): # -> bool:
|
|
...
|
|
|
|
def __iter__(self): # -> Iterator[Unknown]:
|
|
...
|
|
|
|
def append(self, service): # -> None:
|
|
"""Append a service to the list."""
|
|
...
|
|
|
|
def extend(self, services): # -> None:
|
|
"""Appends all services in the iterable to the list."""
|
|
...
|
|
|
|
def __str__(self) -> str:
|
|
...
|
|
|
|
|
|
|
|
class ServiceList(AdvertisingDataField):
|
|
"""Descriptor for a list of Service UUIDs that lazily binds a corresponding BoundServiceList."""
|
|
def __init__(self, *, standard_services, vendor_services) -> None:
|
|
...
|
|
|
|
def __get__(self, obj, cls): # -> ServiceList | tuple[()]:
|
|
...
|
|
|
|
|
|
|
|
class ProvideServicesAdvertisement(Advertisement):
|
|
"""Advertise what services that the device makes available upon connection."""
|
|
match_prefixes = ...
|
|
services = ...
|
|
def __init__(self, *services, entry=...) -> None:
|
|
...
|
|
|
|
@classmethod
|
|
def matches(cls, entry):
|
|
"""Only one kind of service list need be present in a ProvideServicesAdvertisement,
|
|
so override the default behavior and match any prefix, not all.
|
|
"""
|
|
...
|
|
|
|
|
|
|
|
class SolicitServicesAdvertisement(Advertisement):
|
|
"""Advertise what services the device would like to use over a connection."""
|
|
match_prefixes = ...
|
|
solicited_services = ...
|
|
def __init__(self, *services, entry=...) -> None:
|
|
...
|
|
|
|
|
|
|
|
class ManufacturerData(AdvertisingDataField):
|
|
"""Encapsulates manufacturer specific keyed data bytes. The manufacturer is identified by the
|
|
company_id and the data is structured like an advertisement with a configurable key
|
|
format. The order of the serialized data is determined by the order that the
|
|
`ManufacturerDataField` attributes are set in - this can be useful for
|
|
`match_prefixes` in an `Advertisement` sub-class."""
|
|
def __init__(self, obj, *, advertising_data_type=..., company_id, key_encoding=...) -> None:
|
|
...
|
|
|
|
def __len__(self): # -> int:
|
|
...
|
|
|
|
def __bytes__(self): # -> bytes:
|
|
...
|
|
|
|
def __str__(self) -> str:
|
|
...
|
|
|
|
|
|
|
|
class ManufacturerDataField:
|
|
"""A single piece of data within the manufacturer specific data. The format can be repeated."""
|
|
def __init__(self, key, value_format, field_names=...) -> None:
|
|
...
|
|
|
|
def __get__(self, obj, cls): # -> ManufacturerDataField | mdf_tuple | Any | Tuple[Any, ...] | tuple[None, ...] | None:
|
|
...
|
|
|
|
def __set__(self, obj, value): # -> None:
|
|
...
|
|
|
|
|
|
|
|
class ServiceData(AdvertisingDataField):
|
|
"""Encapsulates service data. It is read as a memoryview which can be manipulated or set as a
|
|
bytearray to change the size."""
|
|
def __init__(self, service) -> None:
|
|
...
|
|
|
|
def __get__(self, obj, cls): # -> ServiceData | memoryview | None:
|
|
...
|
|
|
|
def __set__(self, obj, value): # -> None:
|
|
...
|
|
|
|
|
|
|