mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
Change contract for commands to return full event
This commit is contained in:
@@ -37,13 +37,17 @@ async def main():
|
||||
|
||||
# Send the message and get the MSG_SENT event
|
||||
print(f"Sending message: '{args.message}'")
|
||||
send_result = await mc.commands.send_msg(
|
||||
result = await mc.commands.send_msg(
|
||||
contact,
|
||||
args.message
|
||||
)
|
||||
|
||||
if result.type == EventType.ERROR:
|
||||
print(f"⚠️ Failed to send message: {result.payload}")
|
||||
return
|
||||
|
||||
# Extract the expected ACK code
|
||||
expected_ack = send_result["expected_ack"].hex()
|
||||
expected_ack = result.payload["expected_ack"].hex()
|
||||
print(f"Message sent, waiting for ACK with code: {expected_ack}")
|
||||
|
||||
# Wait for the specific ACK that matches our message
|
||||
|
||||
Reference in New Issue
Block a user