Exemplo n.º 1
0
        public MTPDataResponse ExecuteReadDataEx(int code, int param1, int param2, int loop, int counter)
        {
            WaitForReady();
            DeviceIsBusy = true;
            MTPDataResponse res = new MTPDataResponse();
            bool            allok;

            do
            {
                allok = true;
                res   = StillImageDevice.ExecuteReadDataEx(code, param1, param2);
                if ((res.ErrorCode == ErrorCodes.MTP_Device_Busy || res.ErrorCode == PortableDeviceErrorCodes.ERROR_BUSY) &&
                    counter < loop)
                {
                    Thread.Sleep(CONST_READY_TIME);
                    counter++;
                    allok = false;
                }
            } while (!allok);
            DeviceIsBusy = false;
            return(res);
        }