import bluetooth
import time
bt = bluetooth.BLE()               # singleton
bt.active(True)                          # activate BT stack
UART_UUID = bluetooth.UUID('6E400001-B5A3-F393-E0A9-E50E24DCCA9E')
UART_TX = (bluetooth.UUID('6E400003-B5A3-F393-E0A9-E50E24DCCA9E'), bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY,)
UART_RX = (bluetooth.UUID('6E400002-B5A3-F393-E0A9-E50E24DCCA9E'), bluetooth.FLAG_WRITE,)
UART_SERVICE = (UART_UUID, (UART_TX, UART_RX,),)
SERVICES = (UART_SERVICE,)
( (tx, rx,), ) = bt.gatts_register_services(SERVICES)
bt.gap_advertise(100)
[((3, 5, 3, 20), 'bluetooth.BLE', 'bluetooth.BLE', ({}, {}), '()', False, 'import bluetooth\n'), ((5, 12, 5, 66), 'bluetooth.UUID', 'bluetooth.UUID', ({(5, 27, 5, 65): '"""6E400001-B5A3-F393-E0A9-E50E24DCCA9E"""'}, {}), "('6E400001-B5A3-F393-E0A9-E50E24DCCA9E')", False, 'import bluetooth\n'), ((6, 11, 6, 65), 'bluetooth.UUID', 'bluetooth.UUID', ({(6, 26, 6, 64): '"""6E400003-B5A3-F393-E0A9-E50E24DCCA9E"""'}, {}), "('6E400003-B5A3-F393-E0A9-E50E24DCCA9E')", False, 'import bluetooth\n'), ((7, 11, 7, 65), 'bluetooth.UUID', 'bluetooth.UUID', ({(7, 26, 7, 64): '"""6E400002-B5A3-F393-E0A9-E50E24DCCA9E"""'}, {}), "('6E400002-B5A3-F393-E0A9-E50E24DCCA9E')", False, 'import bluetooth\n')]