Created
December 1, 2016 02:22
-
-
Save shayne/3ce20d47ed1a42298e2c132d615e814f to your computer and use it in GitHub Desktop.
reset usb bus linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/ioctl.h> | |
#include <linux/usbdevice_fs.h> | |
void main(int argc, char **argv) | |
{ | |
const char *filename; | |
int fd; | |
filename = argv[1]; | |
fd = open(filename, O_WRONLY); | |
ioctl(fd, USBDEVFS_RESET, 0); | |
close(fd); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo ./reset /dev/bus/usb/003/002