mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
correct SNR values in messages
This commit is contained in:
@@ -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" },
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|||||||
Reference in New Issue
Block a user