Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorsairGetDevices() lacks documentation and provides a useless error. #38

Open
jrlanglois opened this issue Sep 20, 2024 · 1 comment
Open

Comments

@jrlanglois
Copy link

jrlanglois commented Sep 20, 2024

This API is particularly confusing, suffice to say. Apparently if you provide a very large number of devices to request, you get a vague error: CE_InvalidArguments.

This is not ideal for a few reasons:

  1. I have no idea if there's an upper limit as there aren't any outlined.
    • A manual test shows the upper boundary to be 64.
  2. There's no API to call to simply give me all of the devices with the given filter.
    • It could simply provide an "out" parameter with the number.
  3. The error doesn't tell me which argument is invalid, nor does it tell me why.

Can you please provide better in-code docs at the very least.

@jrlanglois
Copy link
Author

FWIW, I found this code at the top of the file:

const unsigned int CORSAIR_DEVICE_COUNT_MAX = 64;     // maximum number of devices to be discovered
const unsigned int CORSAIR_DEVICE_LEDCOUNT_MAX = 512; // maximum number of LEDs controlled by device

It seems reasonable, to me, to add references to them to the related APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant