DelcomOpenDevice() private method

private DelcomOpenDevice ( StringBuilder DeviceName, int Mode ) : uint
DeviceName System.Text.StringBuilder
Mode int
return uint
示例#1
0
        uint GetDelcomDeviceHandle()
        {
            if (string.IsNullOrEmpty(deviceName.ToString()))
            {
                // Search for the first match USB device, For USB IO Chips use USBIODS
                DelcomBuildIndicator.DelcomGetNthDevice(DelcomBuildIndicator.USBDELVI, 0, deviceName);
            }

            var hUsb = DelcomBuildIndicator.DelcomOpenDevice(deviceName, 0); // open the device

            return(hUsb);
        }
示例#2
0
        uint GetDelcomDeviceHandle()
        {
            if (string.IsNullOrEmpty(deviceName.ToString()))
            {
                // Search for the first match USB device, For USB IO Chips use USBIODS
                var devicesFound = DelcomBuildIndicator.DelcomGetNthDevice(0, 0, deviceName);

                if (devicesFound == 0)
                {
                    Console.WriteLine("Can't find build light device, or it's in use by another program");
                }
            }

            var hUsb = DelcomBuildIndicator.DelcomOpenDevice(deviceName, 0); // open the device

            return(hUsb);
        }