예제 #1
0
파일: UnityNfc.cs 프로젝트: inoook/UnityNFC
        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);
        }
예제 #2
0
파일: NfcPcSc.cs 프로젝트: sonnyky/Greeter
        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);
        }