public void Finish() { if (_serialMonitor != null) { _serialMonitor.Stop(); _serialMonitor.Dispose(); _serialMonitor = null; } }
public GameBoyPrinterReader(string portName, Func <byte[], ControllerStateEventArgs> packetParser) { _packetParser = packetParser; _serialMonitor = new SerialMonitor(portName, true); _serialMonitor.PacketReceived += SerialMonitor_PacketReceived; _serialMonitor.Disconnected += SerialMonitor_Disconnected; _serialMonitor.Start(); }