Beispiel #1
0
        /// <summary>
        /// Cancels this transfer.
        /// </summary>
        /// <remarks>
        /// <note title="Libusb-1.0 API Note:" type="cpp">
        /// <see cref="Cancel"/> is roughly equivalent to
        /// <a href="http://libusb.sourceforge.net/api-1.0/group__asyncio.html#ga685eb7731f9a0593f75beb99727bbe54">libusb_cancel_transfer()</a>.
        /// </note>
        /// </remarks>
        /// <returns><see cref="MonoUsbError.Success"/> if the cancel succeeds, otherwise one of the other <see cref="MonoUsbError"/> codes.</returns>
        public MonoUsbError Cancel()
        {
            if (IsInvalid)
            {
                return(MonoUsbError.ErrorNoMem);
            }

            return((MonoUsbError)MonoUsbApi.CancelTransfer(handle));
        }