"""Checks loadability and exact ABI; does not enumerate or open USB.""" import hashlib import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent)) from runtime.sdk import library path = Path("/usr/lib/mission-core-usb-can/sdk/libcontrolcanfd.so") if ( hashlib.sha256(path.read_bytes()).hexdigest() != "3f4681c64b086ecd4bf538908e09ed5203a05286632c0d99485b88f9b069285c" ): raise RuntimeError("Pinned USB-CAN SDK hash changed") library(str(path)) print("USB-CAN SDK load and packed ABI verified; no hardware opened")