The device numbers of usb devices are dependant on startup / installation order. The only reliable way to open a particular usb dongle is to look at all devices to determine the one with the correct serial number (which is unique)
Normally you would use UsbDirect_DeviceCount and then UsbDirect_GetDeviceSerialNumber to give a user a list of USB devices. The serial numbers can then be passed to AAComms_Init
NOTE: Any open connections cannot be discovered using this library, so close all connections before trying to enumerate the available Usb connections
Copyright (C) 2006 RMSD Ltd
Definition in file UsbDirect.h.
Go to the source code of this file.
Defines | |
#define | __DLL_EXPORT |
Enumerations | |
enum | UD_STATUS { , udTIMEOUT, udFAILED, udIOERROR, udDEVICE_NOT_FOUND } |
Indicates the status of the USB connection. More... | |
Functions | |
UD_STATUS __DLL_EXPORT | UsbDirect_WriteBuffer (HANDLE handle, char *lpBuf, DWORD dwToWrite) |
UD_STATUS __DLL_EXPORT | UsbDirect_WaitForChar (HANDLE handle, char *lpBuf, DWORD WaitMsec) |
HANDLE __DLL_EXPORT | UsbDirect_Open (DWORD devId, int baud) |
void __DLL_EXPORT | UsbDirect_Close (HANDLE handle) |
DWORD __DLL_EXPORT | UsbDirect_DeviceCount (void) |
UD_STATUS __DLL_EXPORT | UsbDirect_GetDeviceSerialNumber (DWORD Index, char *buf) |
UD_STATUS __DLL_EXPORT | UsbDirect_GetDeviceDescription (DWORD Index, char *buf) |
UD_STATUS __DLL_EXPORT | UsbDirect_SerialNumToDevNum (char *serialNum, DWORD *devNum) |
|
Indicates the status of the USB connection.
Definition at line 22 of file UsbDirect.h. |
|
This routine writes the provided data to a serial port
|
|
This routine checks to see if a character has been received on the serial port.
|
|
This routine opens a usb - rs485 interface
|
|
Closes a previosly opened port
|
|
Finds the number of connected usb devices |
|
Description: Finds the serial number of a particular usb device
|
|
Gets the description of a particular usb device
|
|
Finds a usb device that has the specified serial number
|