Started implementing message class, parsing rx and tx pgn list

This commit is contained in:
2026-02-21 08:45:39 +01:00
parent 1f5aac778c
commit 02f92bef2a
4 changed files with 231 additions and 7 deletions

View File

@@ -26,6 +26,22 @@ def parse_60928(buf, device):
device.sysinstance = buf[7] & 0x0f # 4bit
return struct.unpack_from('>Q', buf, 0)[0]
def parse_126464(buf, device):
# PGN Lists: tx and rx
# Byte 1: 0 = Transmit PGN list
# 1 = Receive PGN list
functioncode = buf[0]
# set of 24bit PGNs (little endian)
values = { buf[i] | (buf[i+1] << 8) | (buf[i+2] << 16)
for i in range(1, len(buf)-4, 3) }
if functioncode == 0:
device.pgns_transmit = values
elif functioncode == 1:
device.pgns_receive = values
else:
return
device.has_pgnlist = True
def parse_126983(buf, source):
# Alert
# PGN 126984 is response
@@ -93,7 +109,6 @@ def parse_126992(buf, source):
def parse_126993(buf, device):
# Heartbeat
print(f"Heartbeat from {device.address}")
print(buf)
def parse_126996(buf, device):
# Product information