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

Suggestions to make this code more usable as a library #5

Open
Dan-Lightsource opened this issue Apr 21, 2017 · 1 comment
Open

Suggestions to make this code more usable as a library #5

Dan-Lightsource opened this issue Apr 21, 2017 · 1 comment

Comments

@Dan-Lightsource
Copy link

@wjasper Thanks for your work in putting together and sharing this comprehensive library. I found it to be a very useful reference to understand the workings of the underlying hardware interface on these USB devices.

I was initially hoping to use this code as a drop-in library, but encountered some obstacles in doing so.
Here are some suggestions to consider for possible improvements in that regard:

  • Many of the functions will invoke exit() on error. This is undesirable as it can bring down the whole application. Would prefer if it returned a defined set of error codes instead.
  • Many of the functions will invoke printf() and friends in various places. This is undesirable for some applications which need to control what gets printed to stdout/stderr. An option to suppress verbose debug output and error messages would be preferable.
  • return codes from libusb API calls are often not checked and/or not passed up to the application. This means that error conditions often cannot be detected and handled at application level.
@wjasper
Copy link
Owner

wjasper commented Jun 2, 2017

I've tried to remove as many printf and friends a possible. Some are unavoidable. Tried to return as many libusb API calls as possible. Thanks for the suggestion.

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

2 participants