Jump to content

UsbCancelTransfer: Difference between revisions

From EDM2
W.m.brul (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:


==Syntax==
==Syntax==
<pre>
ulrc = UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent)
ulrc = UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent)
</pre>


==Parameters==
==Parameters==
; Handle : the Device Handle received from the previous UsbOpen.
; Handle : the Device Handle received from the previous UsbOpen.
; ucEndpoint : the Endpoint Number appropriate for the asynchronous transfer.
; ucEndpoint : the Endpoint Number appropriate for the asynchronous transfer.
; ucAltSetting : the Alternate Setting of the interface having this endpoint.
; ucAltSetting : the Alternate Setting of the interface having this endpoint.
; ulEvent : the handle of the event semaphore to be posted on completion.
; ulEvent : the handle of the event semaphore to be posted on completion.


==Return Code==
==Return Code==
<pre>
0x0000 - NO_ERROR
0x0000 - NO_ERROR
 
</pre>
===Errors===
===Errors===
<pre>
0x0057 - ERROR_INVALID_PARAMETER
0x0057 - ERROR_INVALID_PARAMETER
0x1B58 - USB_NOT_INIT
0x1B58 - USB_NOT_INIT
 
</pre>
==Remarks==
==Remarks==


Line 39: Line 32:


==Related Functions==
==Related Functions==
* [[UsbStartCtrlTransfer]]
* [[UsbStartDataTransfer]]
* [[UsbStartIsoTransfer]]
* [[UsbIsoClose]]
* [[UsbOpen]]


[[Category:USBCalls]]
[[Category:USBCalls]]

Latest revision as of 22:45, 13 September 2021

Description

Stops asynchronous Control/Data Transfer with a specific endpoint. Stops asynchronous Isochronous Transfers with a specific endpoint.

Syntax

ulrc = UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent)

Parameters

Handle
the Device Handle received from the previous UsbOpen.
ucEndpoint
the Endpoint Number appropriate for the asynchronous transfer.
ucAltSetting
the Alternate Setting of the interface having this endpoint.
ulEvent
the handle of the event semaphore to be posted on completion.

Return Code

0x0000 - NO_ERROR

Errors

0x0057 - ERROR_INVALID_PARAMETER
0x1B58 - USB_NOT_INIT

Remarks

Example Code

//Code Snippet - UsbCancelTransfer
{
  // cancel asynchronous control/data or isochronous transfers
  ulrc = UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent);
  printf("\nUsbCancelTransfer - ulrc: 0x%04X (%hu)",ulrc,ulrc);
}

Related Functions