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.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""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")
|
||||
Reference in New Issue
Block a user