advertising via bluetooth is done

This commit is contained in:
2026-05-15 17:14:33 +10:00
parent 00ac34431d
commit 46ae344c0c
5 changed files with 50 additions and 28 deletions

21
relay/queue.py Normal file
View File

@@ -0,0 +1,21 @@
import uasyncio as asyncio
class Queue:
def __init__(self):
self.items = []
self.waiters = []
async def put(self, item):
self.items.append(item)
if self.waiters:
waiter = self.waiters.pop(0)
waiter.set()
async def get(self):
while not self.items:
event = asyncio.Event()
self.waiters.append(event)
await event.wait()
return self.items.pop(0)