In the Linux source tree, you can take a look at, for instance,
include/linux/usbdevice_fs.h drivers/usb/core/devio.c You may notice some interesting USB specific IOCTLS, such as USBDEVFS_DISCONNECT USBDEVFS_CONNECT USBDEVFS_RESET There may be some interesting documentation in Documentation/DocBook/usb.tmpl You probably need to be root to invoke them. And, they may cause your machine to hang if the drivers are already misbehaving. But, it's worth a try. Relevant C code might look something like this int usb_ioctl( int bus, int device, int iface, int cmd, void* param ) { int rv = -1; int fd = usb_open( bus, device, O_RDWR ); if( fd > 0 ) { struct usbdevfs_ioctl driver_devinfo_ioctl = { iface, cmd, param }; rv = ioctl( fd, USBDEVFS_IOCTL, &driver_devinfo_ioctl ); close( fd ); } return rv; } int usb_connect( int bus, int device ) { return usb_ioctl( bus, device, 0, USBDEVFS_CONNECT, NULL ); } int usb_disconnect( int bus, int device ) { return usb_ioctl( bus, device, 0, USBDEVFS_DISCONNECT, NULL ); } int usb_reset( int bus, int device ) { int rv = -1; int fd = usb_open( bus, device, O_RDWR ); if( fd > 0 ) { rv = ioctl( fd, USBDEVFS_RESET, 0 ); close( fd ); } return rv; } Best of luck, Cory On 7/18/06, Avinash Sridharan <[EMAIL PROTECTED]> wrote:
Hi, I am working with tinyos-2.x on tmotes on FC4. These tmotes are connected to my linux machine through a USB hub so as long as the USB interface doesn't hang it is quiet convenient to program and reprogram these motes. There are times however due to segfaults in my code or due to simulataneous operations that my scripts perform on the USB interface (e.g reading from the flash while accidentaly programming the motes) that the USB serial interface hangs. My question was, is there any mechanism where I can restart these serial interfaces (/dev/ttyUSB*) through software (probably a script in linux that does this) or is it only possible to restart the USB device by unplugging and plugging the motes back in. Thanks, Avinash -- Phd Dept. of Electrical Engineering University of Southern California http://www-scf.usc.edu/~asridhar _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help