c++ - Slow access to HID top-level collection -


brief description:

  • my hid device holds many top-level collections.
  • application queries collection details.
  • bottleneck - setupdigetclassdevs() seems slow.

detailed description:

my code follows ms recommendations on how find , obtain handle hid collection. then, use handle obtain corresponding preparsed data data need.

currently, code every time user needs obtain data (e.g. number of buttons, axis min/max). slow business. profiler says main culprit setupdigetclassdevs() seems slow.

it impossible save handle (or think) may block system making changes such removing device or rearranging devices. still need see happens if hold top-level handle open entire session.

another option contemplating save preparsed data. ms implores release calling hidd_freepreparseddata(). happens if don't?

the last thing thinking of speed-up setupdigetclassdevs(). current usage is:

hdevinfo hardwaredeviceinfo =    setupdigetclassdevs (       &hidguid,      null, // define no enumerator (global)       null, // define no       (digcf_present | // devices present       digcf_deviceinterface)); // function class devices. 

will sped if changed parameters?

simply release preparsed data once done device. if device removed, read or write fail, , can detect looking @ error code calling getlasterror()


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -