BM innovations GmbH BM-USBRTX4 Manual De Usuario

Descargar
Página de 17
 
3DJHRI
4.2 Interface Functions 
 
 
4.2.1 Scan for all BlueRobin devices on ports 
 
This function checks all ports for connected BlueRobin devices having the specified device type, it returns the number of 
connected devices and it generates an internal list with device details which can be accessed then using function 
rtxInterface_GetInfo()
 
bool rtxInterface_ScanForDevices(bmiDeviceType DeviceType, 
                                 int           &NoOfDevicesFound); 
 
Parameters: 
DeviceType  
Scanning for BM-USBD1: 
bmiDEVTYPE_USBD1 
 Scanning 
for 
BM-USBRTX3: 
bmiDEVTYPE_USBRTX3 
 
NoOfDevicesFound  
Number of devices found with specified device type 
 
Return Value: 
Returns true if at least one device could be found, otherwise returns false 
 
 
4.2.2 Get device information for a found BlueRobin device 
 
After having scanned all ports for connected BlueRobin devices of a specific device type using function 
rtxInterface_ScanForDevices() 
this function has to be used to get details for the found devices so that the 
desired device to be opened can be selected. 
 
bool rtxInterface_GetInfo(unsigned char    DeviceIndex, 
                          rtxUsbDeviceInfo *DeviceInfo); 
 
Parameters: 
DeviceIndex  
Index into the device list generated by function rtxInterface_ScanForDevices(); starts at 
0 and can be up to the number of found devices less 1 returned when scanning 
 
DeviceInfo  
Contains the device information for the selected device 
 
typedef struct rtxUsbDeviceInfo 
 { 
 
  unsigned short DeviceType;        // Device type identifier 
 
  char           PortName[256];     // Port name 
 
  char           PhysName[256];     // Physical name 
 
  char           DevDescr[256];     // Friendly name 
 
  char           EnumName[256];     // Enumerator name 
 
  char           LocationName[256]; // USB bus location identifier 
 
  char           SerialNumber[256]; // Serial number 
 
  unsigned short Vid;               // Vendor ID 
 
  unsigned short Pid;               // Product ID 
 } 
rtxUsbDeviceInfo; 
 
Return Value: 
Returns true if device could be found and its information is available, otherwise returns false 
 
 
4.2.3 Start to detect if a BlueRobin device has been unplugged 
 
This function starts background checking if the specified BlueRobin device has been unplugged from the specified port. 
 
bool rtxInterface_UnplugDetectionStart(const char *PortName); 
 
Parameters: 
PortName  
String specifying the port name; will be returned as a part of the USB device information when 
calling function rtxInterface_GetInfo() 
 
Return Value: 
Returns true if BlueRobin device and port has been found, otherwise returns false 
 
Remarks:  
This function is in experimental state!