correct SNR values in messages

This commit is contained in:
Florent
2025-04-18 21:40:59 +02:00
parent d6cfc26689
commit 6a3da79af2
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "meshcore" name = "meshcore"
version = "1.9.6" version = "1.9.7"
authors = [ authors = [
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
{ name="Alex Wolden", email="awolden@gmail.com" }, { name="Alex Wolden", email="awolden@gmail.com" },

View File

@@ -114,7 +114,7 @@ class MessageReader:
elif packet_type_value == 16: # A reply to CMD_SYNC_NEXT_MESSAGE (ver >= 3) elif packet_type_value == 16: # A reply to CMD_SYNC_NEXT_MESSAGE (ver >= 3)
res = {} res = {}
res["type"] = "PRIV" 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["pubkey_prefix"] = data[4:10].hex()
res["path_len"] = data[10] res["path_len"] = data[10]
res["txt_type"] = data[11] 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) elif packet_type_value == 17: # A reply to CMD_SYNC_NEXT_MESSAGE (ver >= 3)
res = {} res = {}
res["type"] = "CHAN" 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["channel_idx"] = data[4]
res["path_len"] = data[5] res["path_len"] = data[5]
res["txt_type"] = data[6] res["txt_type"] = data[6]