Example #1
0
        //Add and Connect Reader
        public void AddDevice(long DeviceID)

        {
            FedmIscReader AdUSBReader;

            AdUSBReader = new FedmIscReader();

            // add ebent listener for protocol streams to be displayed in a window
            AdUSBReader.AddEventListener((FeIscListener)this, FeIscListenerConst.SEND_STRING_EVENT);
            AdUSBReader.AddEventListener((FeIscListener)this, FeIscListenerConst.RECEIVE_STRING_EVENT);

            // max IIDs for each Inventory
            AdUSBReader.SetTableSize(FedmIscReaderConst.ISO_TABLE, 128);

            //Try to connect Readers
            try
            {
                //Connect with USB_Port
                AdUSBReader.ConnectUSB((int)DeviceID);
                map.Add(DeviceID, AdUSBReader);
                this.listBoxUSBReaders.Items.Add(DeviceID.ToString());
                ReaderCount();
                // Read out ReadInfo of connected reader
                AdUSBReader.ReadReaderInfo();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            _reader = new FedmIscReader();

            //Initilize internal table size (default is 0, without initilization, there is no table to place data coming in)
            _reader.SetTableSize(FedmIscReaderConst.BRM_TABLE, 255);


            //Create a new FedmTaskListener object, this Interface implements the OnNewNotificaiton() method, which will fire when the reader sends through a new notificaiton
            FedmTaskListener listener = new NotificaitonTaskListener(_reader);

            //Set up FedmTaskOption, this is where you configure the port to listen to, as well as the option to reply with an acknoledgement
            FedmTaskOption taskOpt = new FedmTaskOption()
            {
                IPPort        = 10005,
                NotifyWithAck = 0 // 0 = Off, 1 = Off
            };

            Console.WriteLine("Begin Listening");
            Console.WriteLine();

            //Initialize notificaiotn listening, by starting a new background task
            _reader.StartAsyncTask(FedmTaskOption.ID_NOTIFICATION, listener, taskOpt);


            listener.OnNewNotification(1, "172.20.43.67", 10005);



            Console.ReadKey();
        }
        public TagHandlerSample()
        {
            InitializeComponent();

            Reader = new FedmIscReader();

            // initializes the internal table for max. 50 tags per Inventory
            Reader.SetTableSize(FedmIscReaderConst.ISO_TABLE, 50);
        }
Example #4
0
 //Constructor
 public NotificationSample()
 {
     InitializeComponent();
     try
     {
         reader = new FedmIscReader();
         reader.SetTableSize(FedmIscReaderConst.BRM_TABLE, 255);             // max 255 tag with each notification
         taskOpt = new FedmTaskOption();
     }
     catch (FedmException ex)
     {
         MessageBox.Show(ex.ToString());
         return;
     }
 }
Example #5
0
        public bool Scanning;                                           // to check from outside if the Communicator is currently scanning for chips



        /////////////////////// Methods ///////////////////////
        ///////////////////////////////////////////////////////

        // Constuctor
        private ReaderCommunicator()
        {
            try
            {
                _reader = new FedmIscReader();
                Logger.GetInstance().Log("RC: FedmIscReader constructed");
            }
            catch (Exception e)
            {
                Logger.GetInstance().Log("RC: --EXCEPTION caught when generating a new FedmIscReader object: " + e.Message);
            }

            //TODO check if constructing was possible?
            _reader.SetTableSize(TableId, TableSize); // set the table used to the tableID and the dependent size
            Logger.GetInstance().Log("RC: Tablesize set");
        }
Example #6
0
        void AddDevice(int deviceId)
        {
            var device = new FedmIscReader();

            device.SetTableSize(FedmIscReaderConst.ISO_TABLE, 128);

            try
            {
                device.ConnectUSB(deviceId);
                Devices.Add(deviceId, device);
                device.ReadReaderInfo();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e);
            }
        }
        public APDU_Sample()
        {
            try
            {
                fedm      = new FedmIscReader();
                APDU_Prot = new FedmCprApdu(this);
                fedm.SetTableSize(FedmIscReaderConst.ISO_TABLE, 128);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), "Error");
            }



            config = new PortConnection();
            config.PortConfig(ref fedm);
            DialogResult reponse = config.ShowDialog();

            // Check Reader - Support of APDUs
            if (fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR02 ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR04_U ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR40_XX ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR40_XX_U ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR50_XX ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR52_XX ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR44_XX ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPR30_XX ||
                fedm.GetReaderType() == FedmIscReaderConst.TYPE_CPRM02)
            {
            }
            else
            {
                MessageBox.Show(this, "Reader doesn't support APDU commands!", "Error");
            }

            InitializeComponent();
            // First send "Inventory" and select Tag before APDU Input
            this.button_sendAPDU.Enabled    = false;
            this.maskedTextBox_APDU.Enabled = false;
        }
Example #8
0
 public ReaderController(FedmIscReader reader)
 {
     _reader = reader;
     _reader.SetTableSize(FedmIscReaderConst.ISO_TABLE, 255);
 }
Example #9
0
 private void LeserApplikation_Load(object sender, System.EventArgs e)
 {
     reader = new FedmIscReader();
     int back = reader.SetTableSize(FedmIscReaderConst.ISO_TABLE, 128);
 }
        public ISOHostSample()
        {
            try
            {
                fedm = new FedmIscReader();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), "Error");
            }

            //declaration from Thread
            Thread MyThread = new Thread(new ThreadStart(ReadThread));

            fedm.SetTableSize(FedmIscReaderConst.ISO_TABLE, 128);

            config = new PortConnection();
            config.PortConfig(ref fedm);
            DialogResult reponse = config.ShowDialog();


            if (fedm.Connected == true)
            {
                try
                {
                    fedm.ReadCompleteConfiguration(false);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.ToString(), "Error");
                }
                // set Persistence Reset Time in Reader Configuration to zero
                // this speeds up inventory cycles
                int back = OBID.Fedm.ERROR_UNSUPPORTED_NAMESPACE;
                try
                {
                    back = fedm.TestConfigPara(OBID.ReaderConfig.Transponder.PersistenceReset.Antenna.No1.PersistenceResetTime);
                }
                catch (Exception ex)
                { // ignore Exception
                }
                // if reader supports this parameter, set it !
                if (0 == back)
                {
                    try
                    {
                        back = fedm.GetConfigPara(OBID.ReaderConfig.Transponder.PersistenceReset.Antenna.No1.PersistenceResetTime, out persistenceResetTime, false);
                        back = fedm.SetConfigPara(OBID.ReaderConfig.Transponder.PersistenceReset.Antenna.No1.PersistenceResetTime, (uint)0, false);
                        if (back == 1) // return value 1 indicates modified parameter
                        {
                            back = fedm.ApplyConfiguration(false);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.ToString(), "Error");
                    }
                }
            }

            // Init Dialogs Authent
            authmifare_config = new AuthentMifare(this.fedm);
            authmyd_config    = new AuthentMYD(this.fedm);

            if (fedm.Connected == true && reponse == DialogResult.Cancel)
            {
                InitializeComponent();

                //set read Mode
                this.comboBoxMod.SelectedIndex = 1;

                //set bank for UHF
                this.comboBoxBank.SelectedIndex = 3;
                this.comboBoxBank.Enabled       = false;

                // set blockSize
                this.numericUpDownDBS.Minimum   = 1;
                this.numericUpDownDBS.Maximum   = 256;
                this.numericUpDownDBS.Increment = 1;
                this.numericUpDownDBS.Value     = 4;

                // set the number of blocks
                this.numericUpDownDBN.Minimum   = 1;
                this.numericUpDownDBN.Maximum   = 256;
                this.numericUpDownDBN.Increment = 1;
                this.numericUpDownDBN.Value     = 1;

                // set status of Authent Buttons
                this.button_Authent_myd.Enabled   = false;
                this.button_AuthentMifare.Enabled = false;

                this.checkBoxEnable.Checked = true;

                //Registry from Events send and receive
                fedm.AddEventListener(this, FeIscListenerConst.SEND_STRING_EVENT);
                fedm.AddEventListener(this, FeIscListenerConst.RECEIVE_STRING_EVENT);

                //Init from  TextEditor
                HexEdit.SetSize(128, 4, BnkIdx);

                //Thread starten in Background
                running = false;
                MyThread.IsBackground = true;
                MyThread.Start();
            }
            else
            {
                config.ShowDialog();
            }
        }