Beispiel #1
0
        public NfcInitiatorTarget Poll(NfcModulation[] modulations, byte pollNr, byte period)
        {
            IntPtr nfcTarget;
            int    count = NativeMethods.initiator_poll_target(this.m_device.Handle, modulations, modulations.Length, pollNr, period, out nfcTarget);

            if (count < 0)
            {
                NfcException.Raise((NfcError)count);
            }
            if (count == 0)
            {
                return(null);
            }
            NfcInitiatorTarget target = new NfcInitiatorTarget(this, nfcTarget);

            return(target);
        }
        public NfcInitiator InitInitiator(bool secure)
        {
            NfcError ret;

            if (secure)
            {
                ret = NativeMethods.initiator_init_secure_element(this.m_ptr);
            }
            else
            {
                ret = NativeMethods.initiator_init(this.m_ptr);
            }

            NfcException.Raise(ret);

            return(new NfcInitiator(this));
        }