Exemplo n.º 1
0
        public static void GetUSBDevices(ConnectorRegistry connectors, List <ProcessInfo> processes)
        {
            if (!Initialized)
            {
                return;
            }

            try {
                uint count = Usbmuxd.UsbmuxdGetDeviceCount();
                for (uint i = 0; i < count; i++)
                {
                    var device = new Usbmuxd.iOSDevice();
                    if (Usbmuxd.UsbmuxdGetDevice(i, out device) && !string.IsNullOrEmpty(device.udid))
                    {
                        var name      = GetNameForDevice(device);
                        var processId = connectors.GetProcessIdForUniqueId(device.udid);

                        processes.Add(new ProcessInfo(processId, "Unity iOS USB: " + name));
                        connectors.Connectors[processId] = new iOSUsbConnector(device.udid);
                    }
                }
            } catch (Exception e) {
                LoggingService.LogError("Error while getting USB devices", e);
            }
        }
Exemplo n.º 2
0
        static string GetNameForDevice(Usbmuxd.iOSDevice device)
        {
            iOSDeviceDescription description;

            if (FindDescription(0x05AC, device.productId, out description))
            {
                return(description.type + " (" + description.model + ")");
            }
            else
            {
                return("Unknown iOS device");
            }
        }
Exemplo n.º 3
0
 static string GetNameForDevice(Usbmuxd.iOSDevice device)
 {
     return(FindDescription(0x05AC, device.productId, out var description)
         ? description.type + " (" + description.model + ")"
         : "Unknown iOS device");
 }