mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
updated tcp_msg with ack mgmt ...
This commit is contained in:
parent
b84f568296
commit
5e6483d67d
1 changed files with 6 additions and 2 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue