Hello!
New post for Windows 10 and Raspberry Pi 2 series
- Hardware and software (1 on N)
- Boot from SD card in the device (2 of N)
- Hello World mode! (3 of N)
- Visual Studio deployment process and Web Management app (4 on N)
- Hello Blinky !!! (5 on N)
- Some admin tasks, like change password and change name (6 on N)
- List of connected devices in the Raspberry Pi 2 (7 on N)
- Deploy an app using the deploy package (8 on N)
Today we will use a little class DeviceInformation which was quite improved in Windows 8.1 to list all the devices connected to our Raspbery PI.
The example is quite simple, just an async call to DeviceInformation.FindAllAsync(), a some LINQ to eliminate duplicates
The output we have is something similar to this one
- Generic SU32G SD Card
- {-\\?\STORAGE#Volume#{06b09fe3-ebbb-11e4-8d8e-806e6f6e6963}#0000000004800000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b id}
- MINWINPC
- {-\\?\ACPI#A_-_ARM_Family_7_Model_C07_Revision___5#1#{dbe4373d-3c81-40cb-ace4-e0e5d05f0c9f id}
- Generic USB Hub
- -Id \\?\USB#VID_0424 & PID_EC00 #5 & 3753427a & 0 & 1 #{a5dcbf10-6530-11d2-901f-00c04fb951ed}
- Generic Non-PnP Monitor
- -Id \\?\DISPLAY#Default_Monitor#1 & 8713bca & 0 & UID0 #{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
- Microsoft GS Wavetable Synth
- {-Id \\?\SWD#MMDEVAPI#MicrosoftGSWavetableSynth#{6dc23320-ab33-4ce4-80d4-bbb3ebbf2814}
- Microsoft USB Optical Mouse
- -Id \\?\USB#VID_045E & PID_0737 #5 & 3753427a & 0 & 5 #{a5dcbf10-6530-11d2-901f-00c04fb951ed}
In addition to the name property, it is important to take take a look at the ID property, which shows the full path to access the device. For example, in the list, the 6th item is the mouse, and we can infer the values of Vendor Id and Product Id very easily
- ID:VID_045E&PID_0737\\?\USB# #5 & 3753427a & 0 & 5 #{a5dcbf10-6530-11d2-901f-00c04fb951ed}
- Vendor Id = 045E
- Product Id = us
Which are always useful when working with connected devices.
Just as a curiosity, this is part of the output of the same app run in local mode on my laptop. This Universal apps is liking me 😉
As always the code on GitHub that can be downloaded from here.
Saludos @ Home
/El Bruno
MSDN Device Information, https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.devices.enumeration.deviceinformation.aspx
11 comments