python-validity/validitysensor/blobs.py
2020-12-20 17:09:58 +01:00

22 lines
822 B
Python

def __load_blob(blob: str) -> bytes:
from .usb import usb
if usb.usb_dev().idVendor == 0x138a:
if usb.usb_dev().idProduct == 0x0090:
from . import blobs_90 as blobs
elif usb.usb_dev().idProduct == 0x0097:
from . import blobs_97 as blobs
elif usb.usb_dev().idProduct == 0x009d:
from . import blobs_9d as blobs
elif usb.usb_dev().idVendor == 0x06cb:
if usb.usb_dev().idProduct == 0x009a:
from . import blobs_9a as blobs
globals()[blob] = getattr(blobs, blob)
return globals()[blob]
init_hardcoded = lambda: __load_blob('init_hardcoded')
init_hardcoded_clean_slate = lambda: __load_blob('init_hardcoded_clean_slate')
reset_blob = lambda: __load_blob('reset_blob')
db_write_enable = lambda: __load_blob('db_write_enable')