from __future__ import annotations

from typing import Optional

from pymulator.core.can import CANFrame, CANInterface, ReadError


class VirtualCANInterface(CANInterface):
    def __init__(self) -> None:
        self.bitrate = -1

    def open(self, bitrate: int) -> None:
        self.bitrate = bitrate

    def close(self) -> None:
        self.bitrate = -1

    def read(self, timeout_ms: int) -> CANFrame:
        raise ReadError("no data")

    def write(self, frame: CANFrame) -> None:
        return
