feat(espnow): Pi bridge client, binary wire, and espnow-sender firmware
Replace serial/Wi-Fi driver transport paths with WebSocket bridge client, binary espnow_wire delivery, device announce registry, and restructured espnow-sender (AP + broadcast passthrough). Includes docs and tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
28
espnow-sender/lib/aioespnow.py
Normal file
28
espnow-sender/lib/aioespnow.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# aioespnow module for MicroPython on ESP32 and ESP8266
|
||||
# MIT license; Copyright (c) 2022 Glenn Moloney @glenn20
|
||||
# Vendored from micropython-lib/micropython/aioespnow
|
||||
|
||||
import asyncio
|
||||
import espnow
|
||||
|
||||
|
||||
class AIOESPNow(espnow.ESPNow):
|
||||
async def arecv(self):
|
||||
yield asyncio.core._io_queue.queue_read(self)
|
||||
return self.recv(0)
|
||||
|
||||
async def airecv(self):
|
||||
yield asyncio.core._io_queue.queue_read(self)
|
||||
return self.irecv(0)
|
||||
|
||||
async def asend(self, mac, msg=None, sync=None):
|
||||
if msg is None:
|
||||
msg, mac = mac, None
|
||||
yield asyncio.core._io_queue.queue_write(self)
|
||||
return self.send(mac, msg, sync)
|
||||
|
||||
def __aiter__(self):
|
||||
return self
|
||||
|
||||
async def __anext__(self):
|
||||
return await self.airecv()
|
||||
Reference in New Issue
Block a user