advertising¶
Advertising is the first phase of BLE where devices can broadcast
-
to_hex(seq)¶ Pretty prints a byte sequence as hex values.
-
to_bytes_literal(seq)¶ Prints a byte sequence as a Python bytes literal that only uses hex encoding.
-
decode_data(data, *, key_encoding='B')¶ Helper which decodes length encoded structures into a dictionary with the given key encoding.
-
compute_length(data_dict, *, key_encoding='B')¶ Computes the length of the encoded data dictionary.
-
encode_data(data_dict, *, key_encoding='B')¶ Helper which encodes dictionaries into length encoded structures with the given key encoding.
-
class
AdvertisingDataField¶ Top level class for any descriptor classes that live in Advertisement or its subclasses.
-
class
AdvertisingFlag(bit_position)¶ A single bit flag within an AdvertisingFlags object.
-
class
AdvertisingFlags(advertisement, advertising_data_type)¶ Standard advertising flags
-
limited_discovery¶ Discoverable only for a limited time period.
-
general_discovery¶ Will advertise until discovered.
-
le_only¶ BR/EDR not supported.
-
-
class
String(*, advertising_data_type)¶ UTF-8 encoded string in an Advertisement.
Not null terminated once encoded because length is always transmitted.
-
class
LazyObjectField(cls, attribute_name, *, advertising_data_type, **kwargs)¶ Non-data descriptor useful for lazily binding a complex object to an advertisement object.
-
advertising_data_type¶ Return the data type value used to indicate this field.
-
-
class
Advertisement¶ Core Advertisement type
-
short_name¶ Short local device name (shortened to fit).
-
complete_name¶ Complete local device name.
-
tx_power¶ Transmit power level
-
appearance¶ Appearance.
-
classmethod
from_entry(entry)¶ Create an Advertisement based on the given ScanEntry. This is done automatically by
BLERadiofor all scan results.
-
rssi¶ Signal strength of the scanned advertisement. Only available on Advertisements returned from
BLERadio.start_scan(). (read-only)
-
classmethod
matches(entry)¶ Returns true if the given
_bleio.ScanEntrymatches all portions of the Advertisement type’s prefix.
-
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.
-
class
BoundServiceList(advertisement, *, standard_services, vendor_services)¶ Sequence-like object of Service UUID objects. It stores both standard and vendor UUIDs.
-
append(service)¶ Append a service to the list.
-
extend(services)¶ Appends all services in the iterable to the list.
-
-
class
ServiceList(*, standard_services, vendor_services)¶ Descriptor for a list of Service UUIDs that lazily binds a corresponding BoundServiceList.
-
class
ProvideServicesAdvertisement(*services)¶ Advertise what services that the device makes available upon connection.
-
services¶ List of services the device can provide.
-
classmethod
matches(entry)¶ Returns true if the given
_bleio.ScanEntrymatches all portions of the Advertisement type’s prefix.
-
-
class
SolicitServicesAdvertisement(*services)¶ Advertise what services the device would like to use over a connection.
-
solicited_services¶ List of services the device would like to use.
-
-
class
ManufacturerData(obj, *, advertising_data_type=255, company_id, key_encoding='B')¶ 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.
-
class
ManufacturerDataField(key, value_format, field_names=None)¶ A single piece of data within the manufacturer specific data. The format can be repeated.
-
class
ServiceData(service)¶ Encapsulates service data. It is read as a memoryview which can be manipulated or set as a bytearray to change the size.