Device.Net icon indicating copy to clipboard operation
Device.Net copied to clipboard

Working with Composite Devices on Windows 10

Open davidehnis opened this issue 7 years ago • 10 comments

When I attempt to use Device.Net (2.7) with my iPhone use an instance of FilterDeviceDefinition, the library doesn't find it. When looking for it via Device Manager (Windows 10), the device is shown under a composite usb manifest.

When I look for it via code using the Management object searcher, it finds the device without issue.

ManagementObjectCollection collection; using (var searcher = new ManagementObjectSearcher ($"Select * From Win32_PnPEntity WHERE DeviceID Like '%{deviceId}&MI_%'")) collection = searcher.Get();

when I use device.net to accomplish the same thing, using the code below, GetDevices() doesn't return the iPhone:

`var deviceDefinitions = new List { new FilterDeviceDefinition{ DeviceType= DeviceType.Usb, VendorId= 0x05AC, ProductId=0x12A8, Label="Apple iPhone" }, };

var devices = await DeviceManager.Current.GetDevices(deviceDefinitions);`

davidehnis avatar Apr 11 '19 14:04 davidehnis

@davidehnis interesting. I will test with an iPhone myself and see what happens. Thanks.

MelbourneDeveloper avatar Apr 11 '19 17:04 MelbourneDeveloper

@davidehnis out of curiosity, what are you trying to do with the iPhone? The iPhone might not be responding because it doens't have a custom device type. Generally, iPhones only allow transferring files backward and forward. For that I would recommend standard file transfer instead of Device.Net.

Is there some transfer mode on a iPhone that I don't know about?

MelbourneDeveloper avatar Apr 12 '19 22:04 MelbourneDeveloper

@MelbourneDeveloper , mainly I using it as a testing vehicle. I'm creating a solution that will need to connect to a custom device. I was just making sure that device.net could find any device and that's it. Just using the iPhone to plan/test for the actual.

davidehnis avatar Apr 13 '19 18:04 davidehnis

@davidehnis that makes sense. However, it might be the case that Apple have not registered any custom Hid or USB devices for the iPhone. That would mean that they may show up in a scan, but Device.Net won't include them in the returned list because it can't get enough information about the device. I still plan to test that hypothesis for myself, but I'd recommend testing with some device that you know has a custom interface.

MelbourneDeveloper avatar Apr 13 '19 22:04 MelbourneDeveloper

@MelbourneDeveloper , that's fair. So it's like I'm getting a false negative.

davidehnis avatar Apr 15 '19 11:04 davidehnis

@davidehnis I'm guessing so. I will see if I can get my hands on an iPhone.

MelbourneDeveloper avatar Apr 15 '19 11:04 MelbourneDeveloper

Does anyone have an iPhone? I probably won't have access for a couple of weeks.

MelbourneDeveloper avatar Apr 19 '19 23:04 MelbourneDeveloper

I don't know if this is relevant here or not but I thought I would mention it incase it's helpful but I have some external scanning sleds that I use with ipods and before any of my apps can make use of the sled I had to add this to the info plist.

<key>UISupportedExternalAccessoryProtocols</key>
<array>
	<string>com.datecs.linea.pro.msr</string>
	<string>com.datecs.linea.pro.bar</string>
</array>

AlmaJensen avatar May 02 '19 04:05 AlmaJensen

@AlmaJensen that's interesting. Are you talking about the plist for an iPod app? Or a Mac app?

MelbourneDeveloper avatar May 02 '19 05:05 MelbourneDeveloper

@davidehnis I have pushed out a new release that has more error logging - especially around enumerating connected devices. I have also updated the wiki on how to enable logging. You might want to try it. It may give you information about why the iPhone doesn't show up.

https://github.com/MelbourneDeveloper/Device.Net/wiki/Enumerating-Connected-Devices

MelbourneDeveloper avatar Jun 23 '19 01:06 MelbourneDeveloper