mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
timeout on waiting ack
This commit is contained in:
parent
84aee617d5
commit
5c269bc662
1 changed files with 7 additions and 2 deletions
9
mccli.py
9
mccli.py
|
|
@ -516,9 +516,14 @@ class MeshCore:
|
||||||
""" Wait for a message """
|
""" Wait for a message """
|
||||||
await self.rx_sem.acquire()
|
await self.rx_sem.acquire()
|
||||||
|
|
||||||
async def wait_ack(self):
|
async def wait_ack(self, timeout=10):
|
||||||
""" Wait ack """
|
""" Wait ack """
|
||||||
await self.ack_ev.wait()
|
try:
|
||||||
|
await asyncio.wait_for(self.ack_ev.wait(), timeout)
|
||||||
|
return True
|
||||||
|
except TimeoutError :
|
||||||
|
printerr("Timeout waiting ack")
|
||||||
|
return False
|
||||||
|
|
||||||
async def next_cmd(mc, cmds):
|
async def next_cmd(mc, cmds):
|
||||||
""" process next command """
|
""" process next command """
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue