Advertisement
sanezek

devices

May 29th, 2020
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using HidSharp;
  2. using System.Collections.Generic;
  3. using System;
  4.  
  5. namespace device_test
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             IEnumerable<HidDevice> Devices = DeviceList.Local.GetHidDevices();
  12.             foreach (HidDevice device in Devices)
  13.             {
  14.                 Console.WriteLine(device.ToString());
  15.                 Console.WriteLine(device.GetFileSystemName());
  16.                 HidStream stream;
  17.                 Console.WriteLine(Convert.ToString(device.TryOpen(out stream)));
  18.                 Console.WriteLine(Convert.ToString(device.GetMaxInputReportLength()));
  19.                 //byte[] raws = device.GetRawReportDescriptor();
  20.                 //foreach (byte raw in raws)
  21.                 //{
  22.                 //    Console.WriteLine("   {0,-8}  -->  0x{1}",
  23.                 //                    raw, Convert.ToString(raw, 2));
  24.                 //}
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement