Files
NODEDC_MISSION_CORE/plugins/usb-can/packaging/native_check.py
T
DCCONSTRUCTIONS 8b210258ca feat(usb-can): add isolated adapter runtime and confirmed CAN transactions
Package the adapter SDK boundary and runtime lifecycle. Confirm admitted CAN transactions, bound retained data and test failure paths with synthetic hardware.
2026-10-29 09:09:59 +03:00

18 lines
562 B
Python

"""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")