From 6a3da79af2fdc5903d0244c1969e272598aa7edb Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 18 Apr 2025 21:40:59 +0200 Subject: [PATCH] correct SNR values in messages --- pyproject.toml | 2 +- src/meshcore/reader.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e00c544..f47ae71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "1.9.6" +version = "1.9.7" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Alex Wolden", email="awolden@gmail.com" }, diff --git a/src/meshcore/reader.py b/src/meshcore/reader.py index 0ceda6d..3e2fd1b 100644 --- a/src/meshcore/reader.py +++ b/src/meshcore/reader.py @@ -114,7 +114,7 @@ class MessageReader: elif packet_type_value == 16: # A reply to CMD_SYNC_NEXT_MESSAGE (ver >= 3) res = {} res["type"] = "PRIV" - res["SNR"] = int.from_bytes(data[1:2], byteorder='little', signed=True) * 4 + res["SNR"] = int.from_bytes(data[1:2], byteorder='little', signed=True) / 4 res["pubkey_prefix"] = data[4:10].hex() res["path_len"] = data[10] res["txt_type"] = data[11] @@ -151,7 +151,7 @@ class MessageReader: elif packet_type_value == 17: # A reply to CMD_SYNC_NEXT_MESSAGE (ver >= 3) res = {} res["type"] = "CHAN" - res["SNR"] = int.from_bytes(data[1:2], byteorder='little', signed=True) * 4 + res["SNR"] = int.from_bytes(data[1:2], byteorder='little', signed=True) / 4 res["channel_idx"] = data[4] res["path_len"] = data[5] res["txt_type"] = data[6]