From 17c8fe776f0e554fb45eb68f6941d8686a382681 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 9 Apr 2025 18:14:40 +0200 Subject: [PATCH 1/4] logout command --- src/meshcore/meshcore.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/meshcore/meshcore.py b/src/meshcore/meshcore.py index c70c4a9..b7e8006 100644 --- a/src/meshcore/meshcore.py +++ b/src/meshcore/meshcore.py @@ -348,6 +348,11 @@ class MeshCore: printerr ("Timeout ...") return False + async def send_logout(self, dst): + self.login_resp = asyncio.Future() + data = b"\x1d" + dst + pwd.encode("ascii") + return await self.send(data) + async def send_statusreq(self, dst): self.status_resp = asyncio.Future() data = b"\x1b" + dst From b01b7ea6ff46e07b1e1c54239fc27bb80e96d488 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 9 Apr 2025 18:15:02 +0200 Subject: [PATCH 2/4] version up --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b9cf2e..b775ff8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "0.4" +version = "0.4.1" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, ] From c11e5274420beea7a655219649131659b39e3c54 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 9 Apr 2025 18:19:49 +0200 Subject: [PATCH 3/4] fix logout --- pyproject.toml | 2 +- src/meshcore/meshcore.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b775ff8..64bd83a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "0.4.1" +version = "0.4.2" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, ] diff --git a/src/meshcore/meshcore.py b/src/meshcore/meshcore.py index b7e8006..52a9919 100644 --- a/src/meshcore/meshcore.py +++ b/src/meshcore/meshcore.py @@ -350,7 +350,7 @@ class MeshCore: async def send_logout(self, dst): self.login_resp = asyncio.Future() - data = b"\x1d" + dst + pwd.encode("ascii") + data = b"\x1d" + dst return await self.send(data) async def send_statusreq(self, dst): From 2608e27ca05693d55cd967af04146a5620684938 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 11 Apr 2025 17:52:32 +0200 Subject: [PATCH 4/4] chan_msg example --- examples/ble_t1000_chan_msg.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 examples/ble_t1000_chan_msg.py diff --git a/examples/ble_t1000_chan_msg.py b/examples/ble_t1000_chan_msg.py new file mode 100755 index 0000000..996f718 --- /dev/null +++ b/examples/ble_t1000_chan_msg.py @@ -0,0 +1,20 @@ +#!/usr/bin/python + +import asyncio +import json +from meshcore import MeshCore +from meshcore import BLEConnection + +ADDRESS = "t1000" # node ble adress or name +DEST = "mchome" +MSG = "Hello World" + +async def main () : + con = BLEConnection(ADDRESS) + await con.connect() + mc = MeshCore(con) + await mc.connect() + + await mc.send_chan_msg(0, MSG) + +asyncio.run(main())