# Path: bluezero/central.py
# class Central:
#     def __init__(self, device_addr, adapter_addr=None):
#     def available(adapter_address=None):
#     def add_characteristic(self, srv_uuid, chrc_uuid):
#     def load_gatt(self):
#     def services_available(self):
#     def services_resolved(self):
#     def connected(self):
#     def connect(self, profile=None, timeout=35):
#     def disconnect(self):
#     def run(self):
#     def quit(self):
# 
# Path: bluezero/tools.py
# def int_to_uint16(value_in):
# def sint16_to_int(byte_array):
# def bytes_to_xyz(byte_array):
# def int_to_uint32(value_in):
# def bitwise_or_2lists(list1, list2):
# def bitwise_and_2lists(list1, list2):
# def bitwise_xor_2lists(list1, list2):
# def url_to_advert(url, frame_type, tx_power):
# def get_fn_parameters(fn):
# def create_module_logger(module_name):
# 
# Path: bluezero/constants.py
# DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
# DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'
# BLUEZ_SERVICE_NAME = 'org.bluez'
# ADAPTER_INTERFACE = 'org.bluez.Adapter1'
# DEVICE_INTERFACE = 'org.bluez.Device1'
# GATT_MANAGER_IFACE = 'org.bluez.GattManager1'
# GATT_PROFILE_IFACE = 'org.bluez.GattProfile1'
# GATT_SERVICE_IFACE = 'org.bluez.GattService1'
# GATT_CHRC_IFACE = 'org.bluez.GattCharacteristic1'
# GATT_DESC_IFACE = 'org.bluez.GattDescriptor1'
# LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.LEAdvertisingManager1'
# LE_ADVERTISEMENT_IFACE = 'org.bluez.LEAdvertisement1'
# MEDIA_PLAYER_IFACE = 'org.bluez.MediaPlayer1'
# BLUEZERO_DBUS_NAME = 'ukBaz.bluezero'
# BLUEZERO_DBUS_OBJECT = '/ukBaz/bluezero'


from time import sleep
from bluezero import central
from bluezero import tools
from bluezero import constants
        Write string to micro:bit UART service. To read from UART, use

        :return:
        """
        pass

    @uart.setter
    def uart(self, txt):
        data = []
        text = ''
        if len(txt) > 20:
            text = txt[:19]
        else:
            text = txt
        for letter in text:
            data.append(ord(letter))
        self._uart_rx.value = data

    def subscribe_uart(self, user_callback):
        """
        Execute user_callback on data being received on UART service

        :param user_callback:
        :return:
        """
        self.uart_tx_cb = user_callback
        self._uart_tx.add_characteristic_cb(self._uart_read)
        self._uart_tx.start_notify()

    def _uart_read(self, iface, changed_props, invalidated_props):

# Path: bluezero/central.py
# class Central:
#     def __init__(self, device_addr, adapter_addr=None):
#     def available(adapter_address=None):
#     def add_characteristic(self, srv_uuid, chrc_uuid):
#     def load_gatt(self):
#     def services_available(self):
#     def services_resolved(self):
#     def connected(self):
#     def connect(self, profile=None, timeout=35):
#     def disconnect(self):
#     def run(self):
#     def quit(self):
# 
# Path: bluezero/tools.py
# def int_to_uint16(value_in):
# def sint16_to_int(byte_array):
# def bytes_to_xyz(byte_array):
# def int_to_uint32(value_in):
# def bitwise_or_2lists(list1, list2):
# def bitwise_and_2lists(list1, list2):
# def bitwise_xor_2lists(list1, list2):
# def url_to_advert(url, frame_type, tx_power):
# def get_fn_parameters(fn):
# def create_module_logger(module_name):
# 
# Path: bluezero/constants.py
# DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
# DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'
# BLUEZ_SERVICE_NAME = 'org.bluez'
# ADAPTER_INTERFACE = 'org.bluez.Adapter1'
# DEVICE_INTERFACE = 'org.bluez.Device1'
# GATT_MANAGER_IFACE = 'org.bluez.GattManager1'
# GATT_PROFILE_IFACE = 'org.bluez.GattProfile1'
# GATT_SERVICE_IFACE = 'org.bluez.GattService1'
# GATT_CHRC_IFACE = 'org.bluez.GattCharacteristic1'
# GATT_DESC_IFACE = 'org.bluez.GattDescriptor1'
# LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.LEAdvertisingManager1'
# LE_ADVERTISEMENT_IFACE = 'org.bluez.LEAdvertisement1'
# MEDIA_PLAYER_IFACE = 'org.bluez.MediaPlayer1'
# BLUEZERO_DBUS_NAME = 'ukBaz.bluezero'
# BLUEZERO_DBUS_OBJECT = '/ukBaz/bluezero'


# Path: bluezero/microbit.py
from time import sleep
from bluezero import central
from bluezero import tools
from bluezero import constants

        Write string to micro:bit UART service. To read from UART, use

        :return:
        """
        pass

    @uart.setter
    def uart(self, txt):
        data = []
        text = ''
        if len(txt) > 20:
            text = txt[:19]
        else:
            text = txt
        for letter in text:
            data.append(ord(letter))
        self._uart_rx.value = data

    def subscribe_uart(self, user_callback):
        """
        Execute user_callback on data being received on UART service

        :param user_callback:
        :return:
        """
        self.uart_tx_cb = user_callback
        self._uart_tx.add_characteristic_cb(self._uart_read)
        self._uart_tx.start_notify()

    def _uart_read(self, iface, changed_props, invalidated_props):

        if iface != constants.GATT_CHRC_IFACE: