コード例 #1
0
 //constructor
 //operates on a usb device
 public LockController()
 {
     devices = USBDeviceFactory.Enumerate();
     if (devices.Length != 0)
     {
         device = devices[0];
         device.Open();
     }
     tag      = new Tag();
     tag.Type = TagType.ISO_18000_6C_AUTO_DETECT;
 }
コード例 #2
0
 public controller(int i)
 {
     errors           = 0;
     tag              = new Tag();
     tag.Type         = TagType.ISO_18000_6C_AUTO_DETECT;
     devices          = USBDeviceFactory.Enumerate();
     reader_num       = i;
     device           = devices[i];
     byteArrayTagList = new List <byte[]>();
     device.Open();
 }
コード例 #3
0
 //Create a device from the first module detected on the USB bus
 public Boolean CreateUSBDevice()
 {
     Device[] devices;
     devices = USBDeviceFactory.Enumerate();
     if (devices.Length == 0)
     {
         //Console.Out.WriteLine("No USB devices found");
         return(false);
     }
     else
     {
         device = devices[0];
         return(true);
     }
 }
コード例 #4
0
        /**
         * Finds the reader on the computer
         * */
        private Boolean findReader()
        {
            //declare the device array that could be connected to the computer
            //set it to the USBDeviceFactory.Enumerate
            Device[] device = USBDeviceFactory.Enumerate();

            //if there are no devices print responce to screen
            //return false
            if (device.Length == 0)
            {
                Console.Out.WriteLine("No USB Devices Found");
                return(false);
            }
            //if not print found usb and set it to usb
            //return true
            Console.Out.WriteLine("Found USB Reader");
            usb = (USBDevice)device[0];
            return(true);
        }