Esempio n. 1
0
 public void Init(MemoryBankType type, int slots)
 {
     this.type         = type;
     slotCount         = slots;
     this.slots        = new T[slotCount];
     slotSetTimestamps = new float[slotCount];
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleMemoryBankConfig" /> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="bankId">The bank identifier.</param>
 /// <param name="address">The address.</param>
 /// <param name="length">The length.</param>
 /// <param name="initialState">The initial state.</param>
 public SimpleMemoryBankConfig(MemoryBankType type, byte?bankId, ushort address, ushort length, byte[] initialState)
 {
     Type         = type;
     BankId       = bankId;
     Address      = address;
     Length       = length;
     InitialState = new byte[length];
     Array.Copy(initialState, 0, InitialState, 0, length);
 }
Esempio n. 3
0
 public bool WriteTag(CAEN.CAENRFIDTag tag, MemoryBankType MemType, int nStartAddr, int nLength, byte[] data)
 {
     if (!_readerReady)
     {
         return(false);
     }
     try
     {
         _source.WriteTagData_EPC_C1G2(tag, (short)MemType, (short)nStartAddr, (short)nLength, data);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 4
0
 public bool ReadTag(CAEN.CAENRFIDTag tag, MemoryBankType MemType, int nStartAddr, int nLength, out byte[] data)
 {
     if (!_readerReady)
     {
         data = null;
         return(false);
     }
     try
     {
         data = _source.ReadTagData_EPC_C1G2(tag, (short)MemType, (short)nStartAddr, (short)nLength);
     }
     catch
     {
         data = null;
         return(false);
     }
     return(true);
 }
Esempio n. 5
0
 public AIMemoryBank(MemoryBankType type, int slots)
 {
     Init(type, slots);
 }
Esempio n. 6
0
 /// <summary>
 ///     Determines whether to trigger an address write event when writing to the specified memory bank type.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private static bool TriggerWriteEventForMemoryBankType(MemoryBankType type)
 {
     return(type == MemoryBankType.RandomAccessMemory);
 }
Esempio n. 7
0
 public static bool WriteTag(CAENRFIDTag tag, MemoryBankType MemType, int nStartAddr, int nLength, byte[] data)
 {
     try
     {
         source.WriteTagData_EPC_C1G2(tag, (short)MemType, (short)nStartAddr, (short)nLength, data);
         return true;
     }
     catch
     {
         return false;
     }
 }
Esempio n. 8
0
        public static bool ReadTag(CAENRFIDTag tag, MemoryBankType MemType, int nStartAddr, int nLength, out byte[] data)
        {
            try
            {
                data = source.ReadTagData_EPC_C1G2(tag, (short)MemType, (short)nStartAddr, (short)nLength);
            }
            catch
            {
                data = null;
                return false;
            }

            return true;
        }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleMemoryBankConfig" /> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="bankId">The bank identifier.</param>
 /// <param name="address">The address.</param>
 /// <param name="length">The length.</param>
 public SimpleMemoryBankConfig(MemoryBankType type, byte?bankId, ushort address, ushort length)
     : this(type, bankId, address, length, new byte[length])
 {
 }