namespace CanCommon; /// /// Backend-agnostic CAN channel. The benchmark depends only on this interface, /// so the exact same benchmark code runs against any implementation /// (SocketCAN / PEAK PCAN-Basic / a vendor CAN module) by swapping the backend. /// Frames are raw 16-byte SocketCAN can_frame buffers (see ). /// public interface ICanChannel : IDisposable { /// Human-readable channel name (e.g. the network interface). string Name { get; } /// errno from the most recent failed native call (0 if none). int LastErrno { get; } /// Open and bind the channel. Throws on failure. void Open(); /// /// Transmit one 16-byte frame. Returns true when fully written. /// On false, holds the reason (e.g. bus-off / no-buffer). /// bool Send(byte[] frame16); /// /// Blocking receive with the channel's configured timeout. /// Returns 16 on a frame, 0 on timeout, -1 on error. /// int Receive(byte[] frame16, out bool timedOut); void Close(); }