Пример #1
0
// Reset issues a device reset. This method may be called after a failed
// transfer to reset the interface. Returned errors may be safely ignored.
func (d *Device) Reset() error {
	defer time.Sleep(500 * time.Millisecond) // wait for device to settle

	if err := C.libusb_reset_device(d.handle); err != C.LIBUSB_SUCCESS {
		return &libusbError{err}
	}
	return nil
}
Пример #2
0
Файл: usb.go Проект: hanwen/usb
// Perform a USB port reset to reinitialize a device.
func (h *DeviceHandle) Reset() error {
	return toErr(C.libusb_reset_device(h.me()))
}
Пример #3
0
func (d *Device) Reset() error {
	if errno := C.libusb_reset_device(d.handle); errno != 0 {
		return usbError(errno)
	}
	return nil
}
Пример #4
0
func (h *DeviceHandle) Reset() *UsbError {
	return returnUsbError(C.libusb_reset_device(h.handle))
}