uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

mexHID should optionally return multiple matching devices #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
mexHID and IOKit device matching is not always good enough.  In particular, for 
the 1208FS device from measurement computing.

mexHID and IOKit can match the product and vendor IDs, but can't distinguish 
the sub-devices (interfaces?) within the physical device.  However, it's 
trivial to distinguish these in m-code by checking things like number of 
elements or element report IDs.

So mexHID should be able to open and return all the matching devices and let 
the Matlab user decide how to use them.  On the other hand, for opening 
something like a mouse, this behavior is not really desirable.

So mexHID('openMatchingDevice', ...) should take an option, whether to return 
all matches or just the first one.  Better yet, 
mexHID('openAllMatchingDevices', ...) should return the array of matching 
deviceIDs.

Internally, mexHID should call the same API.  This means that 
mexHIDOpenDeviceMatchingProperties should be modified to return a mxArray of 
matching deviceIDs, which might be scalar, depending on an argument.

Original issue reported on code.google.com by Benjamin.Heasly on 26 Aug 2010 at 10:37

GoogleCodeExporter commented 8 years ago
"openAllMatchingDevices" is exactly what I did.  As of r325 mexHID is opening, 
retaining, and returning multiple matches.

Original comment by Benjamin.Heasly on 27 Aug 2010 at 12:11