src.bluetooth_sig.registry.core.uri_schemes

URI Schemes registry for Bluetooth SIG URI beacon parsing.

Used during advertising data parsing to decode Eddystone URI beacons and other URI-based beacon formats.

Attributes

Name

Description

logger

uri_schemes_registry

Classes

Name

Description

UriSchemesRegistry

Registry for Bluetooth URI schemes with lazy loading.

Module Contents

class src.bluetooth_sig.registry.core.uri_schemes.UriSchemesRegistry

Bases: bluetooth_sig.registry.base.BaseGenericRegistry[bluetooth_sig.types.registry.uri_schemes.UriSchemeInfo]

Registry for Bluetooth URI schemes with lazy loading.

This registry loads URI scheme definitions from the official Bluetooth SIG assigned_numbers YAML file, enabling URI beacon decoding for Eddystone and similar beacon formats.

The value field is used as a compact encoding for URI prefixes in advertising data, reducing packet size for common schemes like http://.

Examples

>>> from bluetooth_sig.registry.core.uri_schemes import uri_schemes_registry
>>> info = uri_schemes_registry.get_uri_scheme_info(0x16)
>>> info.name
'http:'
decode_uri_prefix(value: int) str

Decode a URI scheme value to its string prefix.

Convenience method for beacon parsing that returns the scheme string directly, or an empty string if unknown.

Parameters:

value – The URI scheme value from beacon data

Returns:

“), or empty string if unknown

Return type:

The URI scheme string (e.g., “http

get_all_uri_schemes() dict[int, bluetooth_sig.types.registry.uri_schemes.UriSchemeInfo]

Get all registered URI schemes (lazy loads on first call).

Returns:

Dictionary mapping URI scheme values to UriSchemeInfo objects

get_uri_scheme_by_name(name: str) bluetooth_sig.types.registry.uri_schemes.UriSchemeInfo | None

Get URI scheme info by name (lazy loads on first call).

Parameters:

name – URI scheme name (case-insensitive, e.g., “http:”, “https:”)

Returns:

UriSchemeInfo object, or None if not found

get_uri_scheme_info(value: int) bluetooth_sig.types.registry.uri_schemes.UriSchemeInfo | None

Get URI scheme info by value (lazy loads on first call).

Parameters:

value – The URI scheme value (e.g., 0x16 for “http:”)

Returns:

UriSchemeInfo object, or None if not found

is_known_uri_scheme(value: int) bool

Check if URI scheme is known (lazy loads on first call).

Parameters:

value – The URI scheme value to check

Returns:

True if the URI scheme is registered, False otherwise

src.bluetooth_sig.registry.core.uri_schemes.logger
src.bluetooth_sig.registry.core.uri_schemes.uri_schemes_registry