Beispiel #1
0
        IntPtr connect(IntPtr hContext, string readerName)
        {
            IntPtr hCard          = IntPtr.Zero;
            IntPtr activeProtocol = IntPtr.Zero;
            uint   ret            = NfcApi.SCardConnect(hContext, readerName, NfcConstant.SCARD_SHARE_SHARED, NfcConstant.SCARD_PROTOCOL_T1, ref hCard, ref activeProtocol);

            if (ret != NfcConstant.SCARD_S_SUCCESS)
            {
                Debug.LogWarning("カードに接続できません。code = " + ret + " / hCard: " + hCard);
            }
            return(hCard);
        }
Beispiel #2
0
        IntPtr connect(IntPtr hContext, string readerName)
        {
            IntPtr hCard          = IntPtr.Zero;
            IntPtr activeProtocol = IntPtr.Zero;
            uint   ret            = NfcApi.SCardConnect(hContext, readerName, NfcConstant.SCARD_SHARE_SHARED, NfcConstant.SCARD_PROTOCOL_T1, ref hCard, ref activeProtocol);

            if (ret != NfcConstant.SCARD_S_SUCCESS)
            {
                throw new ApplicationException("カードに接続できません。code = " + ret);
            }
            return(hCard);
        }