mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
Change contract for commands to return full event
This commit is contained in:
parent
39ea3cb3f3
commit
6fbf15885d
17 changed files with 231 additions and 104 deletions
|
|
@ -34,10 +34,10 @@ async def main():
|
|||
tag = random.randint(1, 0xFFFFFFFF)
|
||||
result = await mc.commands.send_trace(path=args.path, tag=tag)
|
||||
|
||||
# Check if the result has a success indicator
|
||||
if result.get("success") == False:
|
||||
print(f"Failed to send trace packet: {result.get('reason', 'unknown error')}")
|
||||
elif result:
|
||||
# Check if the result is an error
|
||||
if result.type == EventType.ERROR:
|
||||
print(f"Failed to send trace packet: {result.payload.get('reason', 'unknown error')}")
|
||||
elif result.type == EventType.MSG_SENT:
|
||||
print(f"Trace packet sent successfully with tag={tag}")
|
||||
print("Waiting for trace response matching our tag...")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue