Helper Functions and Exceptions

exception bluetooth.btcommon.BluetoothError
bluetooth.btcommon.is_valid_address(s)

returns True if address is a valid Bluetooth address.

valid address are always strings of the form XX:XX:XX:XX:XX:XX where X is a hexadecimal character. For example, 01:23:45:67:89:AB is a valid address, but IN:VA:LI:DA:DD:RE is not.

bluetooth.btcommon.is_valid_uuid(uuid) → bool

returns True if uuid is a valid 128-bit UUID.

valid UUIDs are always strings taking one of the following forms: XXXX XXXXXXXX XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX where each X is a hexadecimal digit (case insensitive)

bluetooth.btcommon.to_full_uuid(uuid)

converts a short 16-bit or 32-bit reserved UUID to a full 128-bit Bluetooth UUID.