mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 01:02:48 +08:00
771a8b7a55
49ffbe99f disable non-universal checks in hyundai safety 3a85f4c25 use whole route when running safety replay from CLI 098f47a5b Fix leaf brake rx check (#547) b8267341a Add pre commit checks + CI (#545) 339976c3c document tx message addresses better (#543) a618e64d1 fix typing errors 9bece64e8 use mazda init 08db086d5 mazda cleanup 89658d0bd Mazda: safety tests add missing safety checks (#525) bdec1398e Fix length of 0x20b in NISSAN_TX_MSGS, wasn't cancelling ACC (#544) b48c74c2e Adding UNO to automated tests (#538) a5802cdd1 Hyundai: remove unused message from RX checks 9ebde2535 Reset state on safety mode init (#542) d4f3f15c3 Refactor addr check (#541) 5210e51b8 remove unused files 065706459 Hyundai checksum (#540) 07e668eca Fast CI (#539) 5307bf727 Fix multi message iso tp requests 0610ed1e2 Hyundai wheel speed counter is actually 4 bits spread over two signals 0d581aa5f dockerfile optimization eaefa2f6c fix docker file path 243a65f30 pull base image 0dd9470af only push to dockerhub from master 55b79b472 GitHub Actions (#535) b2c720bf4 Dos (#533) 01bf74024 remove 0x1BE checksum test 0bd06c9e0 remove 0x1BE check (breaks some vehicles) c31b899a5 honda bosch longitudinal safety 66250c41d Disable docker layer caching (#534) 6b19fa496 include nissan safety in release build db31886ad gate mazda safety behind debug flag e4558c073 Safety: message length check on RX and TX (#529) git-subtree-dir: panda git-subtree-split: 49ffbe99f65e64d23d27d9d3e37f68bc2368dccd
65 lines
1.5 KiB
Python
Executable File
65 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
import struct
|
|
import time
|
|
from tqdm import tqdm
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
|
|
from panda import Panda, PandaWifiStreaming
|
|
|
|
# test throughput between USB and wifi
|
|
|
|
if __name__ == "__main__":
|
|
print(Panda.list())
|
|
p_out = Panda("108018800f51363038363036")
|
|
print(p_out.get_serial())
|
|
#p_in = Panda("02001b000f51363038363036")
|
|
p_in = Panda("WIFI")
|
|
print(p_in.get_serial())
|
|
|
|
p_in = PandaWifiStreaming() # type: ignore
|
|
|
|
#while True:
|
|
# p_in.can_recv()
|
|
#sys.exit(0)
|
|
|
|
p_out.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
|
|
|
|
set_out, set_in = set(), set()
|
|
|
|
# drain
|
|
p_out.can_recv()
|
|
p_in.can_recv()
|
|
|
|
BATCH_SIZE = 16
|
|
for a in tqdm(list(range(0, 10000, BATCH_SIZE))):
|
|
for b in range(0, BATCH_SIZE):
|
|
msg = b"\xaa"*4 + struct.pack("I", a+b)
|
|
if a%1 == 0:
|
|
p_out.can_send(0xaa, msg, 0)
|
|
|
|
dat_out, dat_in = p_out.can_recv(), p_in.can_recv()
|
|
if len(dat_in) != 0:
|
|
print(len(dat_in))
|
|
|
|
num_out = [struct.unpack("I", i[4:])[0] for _, _, i, _ in dat_out]
|
|
num_in = [struct.unpack("I", i[4:])[0] for _, _, i, _ in dat_in]
|
|
|
|
set_in.update(num_in)
|
|
set_out.update(num_out)
|
|
|
|
# swag
|
|
print("waiting for packets")
|
|
time.sleep(2.0)
|
|
dat_in = p_in.can_recv()
|
|
print(len(dat_in))
|
|
num_in = [struct.unpack("I", i[4:])[0] for _, _, i, _ in dat_in]
|
|
set_in.update(num_in)
|
|
|
|
if len(set_out - set_in):
|
|
print("MISSING %d" % len(set_out - set_in))
|
|
if len(set_out - set_in) < 256:
|
|
print(list(map(hex, sorted(list(set_out - set_in)))))
|