Пример #1
0
        public AndoridDevice[] ListDevice()
        {
            string temp  = SendMessage("devices");
            int    index = temp.IndexOf("List of devices attached");
            List <AndoridDevice> list = new List <AndoridDevice>();

            if (index >= 0)
            {
                temp = temp.Substring(index);
                temp = temp.Replace("List of devices attached \r\n", "");
                temp = temp.Replace("\r\n\r\n", "");
                temp = temp.Replace("\r\n", "|");
                if (temp.Length > 6)
                {
                    foreach (string i in temp.Split('|'))
                    {
                        string[]            temp2  = i.Split('\t');
                        AndoridDeviceStatus status = AndoridDeviceStatus.OnLine;
                        if (temp2.Length > 1 && temp2[1] != "device")
                        {
                            status = AndoridDeviceStatus.OffLine;
                        }
                        list.Add(new AndoridDevice(temp2[0], status));
                    }
                }
            }
            return(list.ToArray());
        }
Пример #2
0
 public AndoridDevice(string deviceId, AndoridDeviceStatus status)
 {
     this.deivceId = deviceId;
     this.status   = status;
 }