Address – BLE address

Encapsulates the address of a BLE device.

class _bleio.Address(address, address_type)

Create a new Address object encapsulating the address value. The value itself can be one of:

Parameters:
address_bytes

The bytes that make up the device address (read-only).

Note that the bytes object returned is in little-endian order: The least significant byte is address_bytes[0]. So the address will appear to be reversed if you print the raw bytes object. If you print or use str() on the Attribute object itself, the address will be printed in the expected order. For example:

>>> import _bleio
>>> _bleio.adapter.address
<Address c8:1d:f5:ed:a8:35>
>>> _bleio.adapter.address.address_bytes
b'5\xa8\xed\xf5\x1d\xc8'
type

The address type (read-only).

One of the integer values: PUBLIC, RANDOM_STATIC, RANDOM_PRIVATE_RESOLVABLE, or RANDOM_PRIVATE_NON_RESOLVABLE.

__eq__(other)

Two Address objects are equal if their addresses and address types are equal.

__hash__()

Returns a hash for the Address data.

PUBLIC

A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits).

RANDOM_STATIC

A randomly generated address that does not change often. It may never change or may change after a power cycle.

RANDOM_PRIVATE_RESOLVABLE

An address that is usable when the peer knows the other device’s secret Identity Resolving Key (IRK).

RANDOM_PRIVATE_NON_RESOLVABLE

A randomly generated address that changes on every connection.