1 (edited by croz 2019-01-21 16:02:37)

Topic: FIXED: Device not seen with HidSharp 2.0.5 on Mac

I am trying to connect to a USB weather station. Previously using HidSharp 1.5 this worked fine on Windows, Linux and Mac. Now I have upgraded to HidSharp 2.0.5 (to remove the libudev 0 requirement), the device is still seen by users on Windows and Linux, but Mac users get a null return when calling GetHidDeviceOrNull() using the VID/PID.

I've added code to list all the devices found when the program starts and this fails on Macs running 2.0.5, but works on Windows and Linux

DeviceList devicelist = DeviceList.Local;
LogMessage("Finding All USB HID Devices");
var allDevices = devicelist.GetAllDevices();
foreach (HidDevice dev in allDevices)
{
    LogMessage("  " + dev.ToString());
}

On Macs this hangs after outputting "Finding All USB HID Devices"
One user has macOS 10.14.2.
Mono 5.16.0.220, 64 bit.

Any ideas? What diagnostics I can gather for you?
I don't have a Mac so I'm having to get users to run test code for me, and I cannot debug.

2

Re: FIXED: Device not seen with HidSharp 2.0.5 on Mac

This is the output from HidSharpTest on Windows for the device in question...

\\?\hid#vid_1941&pid_8021#6&b0925ac&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
(unnamed manufacturer) (unnamed product) (no serial number) (VID 6465, PID 32801, version 1.0)
Max Lengths: Input 9, Output 9, Feature 0
Serial Ports: 
Report Descriptor:
  06 A0 FF 09 01 A1 01 15 00 25 01 35 00 45 01 65 00 55 00 75 01 95 40 81 03 91 03 C1 00 (29 bytes)
  UsagePage 65440
  Usage 1
  Collection 1
    LogicalMinimum 0
    LogicalMaximum 1
    PhysicalMinimum 0
    PhysicalMaximum 1
    Unit 0
    UnitExponent 0
    ReportSize 1
    ReportCount 64
    Input 3
    Output 3
  EndCollection 0
Usage: FFA00001 4288675841
Input: ReportID=0, Length=9, Items=1
  64 Elements x 1 Bits, Units: None, Expected Usage Type: 0, Flags: Constant, Variable, Usages: 
Output: ReportID=0, Length=9, Items=1
  64 Elements x 1 Bits, Units: None, Expected Usage Type: 0, Flags: Constant, Variable, Usages: 
Opening device for 20 seconds...
Opened device.
Closed device.

On a Mac, my test user just got this...

Device list changed.
Device list changed.
Device list changed.
Device list changed.
Device list changed.
Device list changed.
Device list changed.
Device list changed.
Complete device list (took 192 ms to get 0 devices):

3

Re: FIXED: Device not seen with HidSharp 2.0.5 on Mac

Fixed by James in version 2.0.8.
Thanks