MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 1 as of 2013-10-18 14:49:51
  • usb

usb

Reset usb device

  • lsusb
  • cc -o resetusb.c resetusb
  • cp resetusb /usr/sbin
  • ./reset /dev/bus/usb/004/006

   1 #include <stdio.h>
   2 #include <fcntl.h>
   3 #include <errno.h>
   4 #include <sys/ioctl.h>
   5 #include <linux/usbdevice_fs.h>
   6 void main(int argc, char **argv)
   7 {
   8         const char *filename;
   9         int fd;
  10         filename = argv[1];
  11         fd = open(filename, O_WRONLY);
  12         ioctl(fd, USBDEVFS_RESET, 0);
  13         close(fd);
  14         return;
  15 }
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01