import os, json, time, struct, subprocess, re from pathlib import Path root=Path(__file__).resolve().parent project=root.parents[1] dll=project/'tmp/can1-test-20261002/pcan-basic/x64' os.environ['PATH']=str(dll)+os.pathsep+os.environ['PATH'] handle=os.add_dll_directory(str(dll)) import can cli=r'D:\STM32CubeCLT_1.19.0\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe' results=[] for rate in (250000,500000): with can.Bus(interface='pcan',channel='PCAN_USBBUS1',bitrate=rate) as bus: tag=rate+123 data=struct.pack('