From af9f90b5bdd209f5a58216d499c504c39ca694ca Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 5 Mar 2026 12:35:56 -0400 Subject: [PATCH] example to show how to get chan messages with path --- examples/chan_recv_with_path.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/chan_recv_with_path.py diff --git a/examples/chan_recv_with_path.py b/examples/chan_recv_with_path.py new file mode 100644 index 0000000..ee9a62c --- /dev/null +++ b/examples/chan_recv_with_path.py @@ -0,0 +1,18 @@ +import asyncio +from meshcore import MeshCore +from meshcore import EventType +from meshcore import BLEConnection + +async def main () : + mc = await MeshCore.create_ble("f1x") + # this will enable channel log decryption (needed to link path with message) + mc.set_decrypt_channel_logs = True + # get info for channel 0 (needed so the reader has info needed for decryption) + await mc.commands.get_channel(0) + await mc.start_auto_message_fetching() + while True: + result = await mc.wait_for_event(EventType.CHANNEL_MSG_RECV) + if result: + print(result) + +asyncio.run(main())