public RomHeader getRomHeader() { serialPort.PortName = port; bytesToReceive = 0; bytesStream.Clear(); //operation = MegaDumperOperation.Header; serialPort.Open(); lock (transmissionOverLock)//waits N seconds for a condition variable { serialPort.Write("i"); if (!Monitor.Wait(transmissionOverLock, 3000)) { //timeout } else { //business as normal } } serialPort.Close(); RomHeader header = new RomHeader(); header.parse(bytesStream.ToArray()); return(header); }
public void SetHeaderFromRawData(byte[] data) { header = new RomHeader(); header.parse(data); }