chore: Python cleanup

This commit is contained in:
Piotr Dec 2024-07-26 00:38:38 +02:00
parent 01fbf32042
commit 73a57cb742
Signed by: stawros
GPG key ID: F89F27AD8F881A91
2 changed files with 0 additions and 0 deletions

31
python/test.py Normal file
View file

@ -0,0 +1,31 @@
from numpy import uint8
def send_hud(buf: list):
n = len(buf)
chars = []
crc = uint8(0xeb + n + n)
chars.append(0x10)
chars.append(0x7b)
chars.append(n + 6)
if n == 0xa:
chars.append(0x10)
chars.append(n)
chars.append(0x00)
chars.append(0x00)
chars.append(0x00)
chars.append(0x55)
chars.append(0x15)
for char in buf:
crc = uint8(crc + char)
chars.append(char)
if char == 0x10:
chars.append(0x10)
chars.append((-crc) & 0xff)
chars.append(0x10)
chars.append(0x03)
print(chars)
print([bytes(chr(char), 'raw_unicode_escape') for char in chars])
send_hud([0x04, 0x01])