Beispiel #1
0
        public SDBAppCmd(SDBDeviceInfo device, params string[] args)
        {
            List <string> rawItemList = SDBLib.RequestToTargetSync(device.Serial, SDBProtocol.appcmd, CombineArgs(args));

            ConsoleOutput = new List <string>();

            IsTargetFound = (rawItemList != null);
            RetrunString  = string.Empty;
            ExitCode      = SDBReqExitCode.EXIT_DEFAULT_FAILURE;

            if (IsTargetFound)
            {
                foreach (string item in rawItemList)
                {
                    if (HasPrefix(item, SDBProtocol.appcmd_returnstr))
                    {
                        RetrunString = GetPureValue(item);
                    }
                    else if (HasPrefix(item, SDBProtocol.appcmd_exitcode))
                    {
                        ExitCode = ParseInt(item);
                    }
                    else if (!string.IsNullOrWhiteSpace(item))
                    {
                        ConsoleOutput.Add(item.Replace("\r\n\0", string.Empty));
                    }
                }
            }
        }