updated tcp_msg with ack mgmt ...

This commit is contained in:
Florent 2025-04-14 09:40:06 +02:00
parent b84f568296
commit 5e6483d67d

View file

@ -4,10 +4,11 @@ import asyncio
import json
from meshcore import MeshCore
from meshcore import TCPConnection
from meshcore import EventType
HOSTNAME = "mchome"
PORT = 5000
DEST = "t1000"
DEST = "t114_fdl"
MSG = "Hello World"
async def main () :
@ -21,6 +22,9 @@ async def main () :
if contact is None:
print(f"Contact '{DEST}' not found in contacts.")
return
await mc.commands.send_msg(contact ,MSG)
ret = await mc.commands.send_msg(contact ,MSG)
print (ret)
exp_ack = ret["expected_ack"].hex()
print(await mc.wait_for_event(EventType.ACK, attribute_filters={"code": exp_ack}, timeout=5))
asyncio.run(main())