From 830338b20b8e2217c9e60ef752e638d4a42dcb9e Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 6 Jun 2020 11:53:19 -0700 Subject: [PATCH] allow devices to veto this app if we are too old --- meshtastic/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index 53ae30a..24a1dec 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -69,6 +69,9 @@ BROADCAST_NUM = 255 MY_CONFIG_ID = 42 +"""The numeric buildnumber (shared with android apps) specifying the level of device code we are guaranteed to understand""" +OUR_APP_VERSION = 167 + class MeshInterface: """Interface class for meshtastic devices @@ -171,6 +174,9 @@ class MeshInterface: logging.debug(f"Received: {asDict}") if fromRadio.HasField("my_info"): self.myInfo = fromRadio.my_info + if self.myInfo.min_app_version > OUR_APP_VERSION: + raise Exception( + "This device needs a newer python client, please \"pip install --upgrade meshtastic\"") elif fromRadio.HasField("radio"): self.radioConfig = fromRadio.radio elif fromRadio.HasField("node_info"):