Example #1
0
        /// <summary>
        /// Get detected tags
        /// </summary>
        /// <param name="device">The device to get detected tags</param>
        /// <returns>List of detected devices</returns>
        public static FreefareTagList FreefareGetTags(this NfcDevice device)
        {
            IntPtr arrPtr = NativeMethods.freefare_get_tags(device.DangerousGetHandle());

            if (arrPtr == IntPtr.Zero)
            {
                throw new FreefareException("Error listing tags");
            }
            return(new FreefareTagList(arrPtr, device));
        }
Example #2
0
        public static MifareTag SelectMifareTag(this INfcInitiator initiator)
        {
            NfcDevice         device   = (NfcDevice)initiator;
            NfcModulation     ncMifare = new NfcModulation(NfcModulationType.ISO14443A, NfcBaudRate.BR106);
            NfcSelectedTarget target   = initiator.Select(ncMifare);

            if (target == null)
            {
                return(null);
            }

            if (target.Target.TasteMifareClassic1k())
            {
                return(new MifareClassic1kTag(target));
            }
            return(new GenericTag(target));
        }
Example #3
0
 internal NfcTarget(NfcDevice device, IntPtr ptr)
 {
     this.m_device = device;
     this.m_ptr    = ptr;
 }
 internal NfcEmulatedTag(NfcDevice device)
 {
     this.m_device = device;
 }
Example #5
0
 internal NfcTargetList(IntPtr ptr, int count, NfcDevice device) : base(ptr, true)
 {
     this.m_count  = count;
     this.m_device = device;
 }
Example #6
0
 internal NfcSelectedTarget(IntPtr targetPtr, NfcDevice device) : base(targetPtr, true)
 {
     this.m_device = device;
     this.m_target = new NfcTarget(this.m_device, targetPtr);
 }