| Online Development Notebook > Index > Programming Overview > DLL Commands > CloseDevice |
CloseDevice - Close the open device
Description:
This is a USBm.dll function that closes access to a USB device.
Command Syntax:
true⁄false USBm_CloseDevice( device )
The USBm_CloseDevice function syntax has these parts:
| Part | Description |
| device | Valid device from 0 to the maximum number of devices found (minus 1). Any other number results in a FALSE return. |
Remarks:
Note: USBm_CloseDevice returns TRUE if the device successfully closes.
VB Declaration (USBmAPI.bas)
| Public Declare Function USBm_CloseDevice _ Lib "USBm.dll" _ (ByVal device As Byte) _ As Integer |
VB Example
| Dim result As Integer |
result = USBm_CloseDevice 3 |
This code fragment closes device number three. "Result" will contain TRUE or FALSE.
C Prototype
| int USBm_CloseDevice( unsigned char device ); |
C Example
RobotBASIC
usbm_CloseDevice(ne_DeviceNumber)
Returns true if the device was successfully closed. False otherwise.
Hardware: U401 USB Interface U421 USB Interface U451 USB Interface
Programming: USBm DLL Programming Download Files
Application Notes: U4x1 Application Notes Misc Applications and Information FAQ
While every effort has been made to make sure that the information posted on this site is correct, the author can not be held liable for any damages whatsoever for losses as a result of the application of this information. Use this information at your own risk.
USBmicro can design your custom and semi-custom USB product. Email about USB design can be directed to " Robert " at usbmicro.com.
Copyright © USBmicro, L.L.C., 2002-2010