Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void SetHeaderFromRawData(byte[] data)
 {
     header = new RomHeader();
     header.parse(data);
 }