import csv import json from pathlib import Path import struct import tempfile import unittest import zipfile from logic_analyzer.files import read_capture, ImportCancelled def run_bytes(length): value = length - 1 if value < 64: return bytes([value]) parts = [value & 127] value >>= 7 while value >= 64: parts.append(128 | (value & 127)) value >>= 7 return bytes([64 | value] + list(reversed(parts))) def sal_binary(version=1, initial=1): head = b'' + struct.pack('