import random, sys
random.seed(11)
ecus = {"A": (+80e-6, [(0x0C8, 0.010), (0x1A0, 0.020), (0x3E0, 0.100)]),
        "B": (-50e-6, [(0x120, 0.020), (0x2F0, 0.050)]),
        "C": (+20e-6, [(0x260, 0.020), (0x4A0, 0.100), (0x4A8, 0.100)])}
lines = []
for name, (drift, messages) in ecus.items():
    start = random.uniform(0, 0.01)
    for can_id, period in messages:
        phase = random.uniform(0, period)
        n = 0
        while True:
            t = start + phase + n * period * (1 + drift) + random.gauss(0, 40e-6)
            if t > 60: break
            lines.append((1_700_000_000 + t, can_id))
            n += 1
lines.sort()
open(sys.argv[1] if len(sys.argv) > 1 else "bus.log", "w").write("\n".join(f"({t:.6f}) can0 {i:03X}#0000000000000000" for t, i in lines) + "\n")
