From 50998fcfb916ae251309bd4b464f2c122e8cb30d Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 9 Apr 2021 18:38:02 +0200 Subject: Repo re-org --- gm_platform/fw/reader.py | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 gm_platform/fw/reader.py (limited to 'gm_platform/fw/reader.py') diff --git a/gm_platform/fw/reader.py b/gm_platform/fw/reader.py deleted file mode 100644 index c60edb7..0000000 --- a/gm_platform/fw/reader.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -import struct - -import sqlite3 - -import serial -from cobs import cobs - -if __name__ == '__main__': - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument('-b', '--baudrate', type=int, default=250000) - parser.add_argument('port') - parser.add_argument('dbfile') - args = parser.parse_args() - - db = sqlite3.connect(args.db) - ser = serial.Serial(args.port, args.baudrate) - - while True: - packet = ser.read_until(b'\0') - try: - packet = cobs.decode(packet) - crc, seq, struct.decode('IBxH', packet[:8]) - - except Exception as e: - print(e) - -- cgit