UsbClose Procedure

Version 7

 

 

Closes a previously opened USB device.

Syntax

[ lStatus = ] UsbClose ( hDevice )

The UsbClose procedure syntax has the following parts:

 

Name

Type

Description

lStatus

Long

Status: -1 (error), 0 (success)

hDevice

Val AHandle

Handle to the USB device

Remarks

The UsbClose function closes an opened USB device associated with hDevice. Once this function is executed, the hDevice can no longer be used with other USB procedures.

The hDevice specifies the ATEasy USB device handle obtained by the UsbOpen.

The UsbClose function returns -1 upon failure.

Example

If  UsbClose(hDevice) = -1 Then

   Print "Error During UsbClose..."

Endif

See Also

UsbOpen, UsbSetup