1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-03-28 18:06:37 +01:00

Integrate many changes from master

This commit is contained in:
2026-03-18 13:29:57 +01:00
parent b2e67880d3
commit caf833e6ac
107 changed files with 8565 additions and 2688 deletions

29
tools/getPgnType.py Executable file
View File

@@ -0,0 +1,29 @@
#! /usr/bin/env python3
import sys
import json
def err(txt):
print(txt,file=sys.stderr)
sys.exit(1)
HDR='''
PGNM_Fast=0
PGNM_Single=1
PGNM_ISO=2
PGN_MODES={
'''
FOOTER='''
}
'''
with open(sys.argv[1],"r") as ih:
data=json.load(ih)
pgns=data.get('PGNs')
if pgns is None:
err("no pgns")
print(HDR)
for p in pgns:
t=p['Type']
pgn=p['PGN']
if t and pgn:
print(f" {pgn}: PGNM_{t},")
print(FOOTER)