Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get a list of all the USB removable storages attatched in the system using C?
  2. libusb_context * usb_ctx = NULL;
  3.  
  4. int main()
  5. {
  6. ...
  7. libusb_init(&usb_ctx);
  8. ...
  9. libusb_exit(usb_ctx);
  10. ...
  11. }
  12.  
  13. some_func()
  14. {
  15. ...
  16. libusb_device **list;
  17. ssize_t number_of_devices = libusb_get_device_list(usb_ctx, &list);
  18. ...
  19. }