Пример #1
0
        /// <summary>
        ///     Creates and waits for a connected RFID USB device.
        /// </summary>
        /// <param name="serial">Serialkey of the device as identitfier. Useful when multiple devices are connected.</param>
        /// <param name="waitForAttachment">If true, waits for attachment</param>
        public RadioFrequency(int serial, bool waitForAttachment = false)
        {
            // A cache for all the detected keys.
            Cache = new List <string>();

            // Booting up the base API.
            BaseRFID = new P.RFID();
            BaseRFID.open(serial);
            if (waitForAttachment)
            {
                BaseRFID.waitForAttachment();
                InitRadioFrequency();
            }
            else
            {
                BaseRFID.Attach += (sender, args) => InitRadioFrequency();
            }
        }