Beispiel #1
0
        private void UpdateReadersList()
        {
            if (Readers != null)
            {
                CAENRFIDPort isTCP = null;
                ((ListView)FindViewById(Resource.Id.reader_list)).Adapter = null;
                _data.Clear();

                for (int i = 0; i < Readers.Count; i++)
                {
                    DemoReader r = Readers[i];

                    var readerMap = new JavaDictionary <string, object>();
                    isTCP = r.ConnectionType;
                    readerMap["image"] = isTCP == CAENRFIDPort.CaenrfidTcp
                        ? Resource.Drawable.ic_tcp_reader
                        : Resource.Drawable.ic_bt_reader;
                    readerMap["name"] = r.ReaderName;
                    readerMap["info"] = "Serial: " + r.Serial
                                        + "\nFirmware: " + r.FirmwareRelease
                                        + "\nRegulation: " + r.GetRegulation();
                    _data.Add(readerMap);
                }
            }

            string[] from = { "image", "name", "info" };
            int[]    to   = { Resource.Id.reader_image, Resource.Id.reader_name, Resource.Id.reader_info };

            _adapter = new SimpleAdapter(ApplicationContext, _data,
                                         Resource.Layout.list_reader, from, to);

            ((ListView)FindViewById(Resource.Id.reader_list)).Adapter = _adapter;
        }
Beispiel #2
0
        public DemoReader(CAENRFIDReader caenReader, string readerName, string serialNum, string fwRel,
                          CAENRFIDPort connType)
        {
            _reader         = caenReader;
            ReaderName      = readerName;
            Serial          = serialNum;
            FirmwareRelease = fwRel;

            try
            {
                SetRegulation(_reader.RFRegulation);
            }
            catch (CAENRFIDException e)
            {
            }

            ConnectionType = connType;
        }