Beispiel #1
0
        public Fallback(IConsole aConsole, ServiceFlash aServiceFlash)
        {
            iConsole      = aConsole;
            iServiceFlash = aServiceFlash;

            iActionSectors = iServiceFlash.CreateAsyncActionSectors();
            iActionSectors.EventResponse += SectorsResponse;
            iSectorsComplete              = new ManualResetEvent(false);

            iActionRead = iServiceFlash.CreateAsyncActionRead();
            iActionRead.EventResponse += ReadResponse;
            iReadComplete              = new ManualResetEvent(false);

            iActionWrite = iServiceFlash.CreateAsyncActionWrite();
            iActionWrite.EventResponse += WriteResponse;
            iWriteComplete              = new ManualResetEvent(false);

            iActionSectorBytes = iServiceFlash.CreateAsyncActionSectorBytes();
            iActionSectorBytes.EventResponse += SectorBytesResponse;
            iSectorBytesComplete              = new ManualResetEvent(false);

            iActionEraseSector = iServiceFlash.CreateAsyncActionEraseSector();
            iActionEraseSector.EventResponse += EraseSectorResponse;
            iEraseSectorComplete              = new ManualResetEvent(false);
        }
Beispiel #2
0
        public RomDirInfo(IConsole aConsole, ServiceFlash aServiceFlash)
        {
            iConsole      = aConsole;
            iServiceFlash = aServiceFlash;

            iActionRomDirInfo = iServiceFlash.CreateAsyncActionRomDirInfo();
            iActionRomDirInfo.EventResponse += RomDirInfoResponse;
            iRomDirInfoComplete              = new ManualResetEvent(false);

            iRomDirInfoCollected = false;
        }
Beispiel #3
0
        public bool CheckRunningFallback()
        {
            ManualResetEvent never = new ManualResetEvent(false);

            // Wait for device to recover from the battering it gets
            // when it announces itself to the network before trying
            // to retreive its device xml to establish whether it is
            // running the fallback or not.

            WaitFor(never, kMaxRunningFallbackSeconds);

            try
            {
                uint version = iDevice.HasService(ServiceFlash.ServiceType());
                return(version != 0);
            }
            catch (DeviceException)
            {
                throw (new FlashException());
            }
        }