up device id
This commit is contained in:
parent
12fec2f5ec
commit
65b0f86732
8
main.py
8
main.py
@ -14,6 +14,10 @@ else:
|
||||
from pyb import Pin, LED
|
||||
import uasyncio as asyncio
|
||||
|
||||
device_id = ""
|
||||
for b in machine.unique_id():
|
||||
device_id += "{:02X}".format(b)
|
||||
# device_id_hex = int(device_id)
|
||||
|
||||
#### BLE UART ###
|
||||
import ble_uart
|
||||
@ -26,7 +30,7 @@ def print_handler():
|
||||
|
||||
|
||||
ble = bluetooth.BLE()
|
||||
uart = ble_uart.Ble_uart(ble, on_rx=print_handler, name="OpenLaserTag Device")
|
||||
uart = ble_uart.Ble_uart(ble, on_rx=print_handler, name=print("LaserTag"))
|
||||
|
||||
#### OLT IR RX imports ###
|
||||
import ustruct
|
||||
@ -151,6 +155,8 @@ async def cb(byte1, byte2, byte3, packet):
|
||||
async def main(proto):
|
||||
logger.debug("main start")
|
||||
|
||||
print(f"Device ID: {device_id}")
|
||||
|
||||
### alive check ###
|
||||
asyncio.create_task(alive_check())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user