コード例 #1
0
ファイル: RFIDReader.cs プロジェクト: jackshenbin/XD
        private static void  GetUID(int comHandle, out int ret, out string uid)
        {
            byte[] pTxFrame;
            byte[] pRxFrame;

            pTxFrame = new byte[0x400];
            pRxFrame = new byte[0x400];

            byte mode = 1;
            ISO14443A_UIDPARAM param = new ISO14443A_UIDPARAM();

            Trace.WriteLine("iso14443AGetUID");
            ret = protocol.iso14443AGetUID(comHandle, 0x0000, 0x0001, mode, ref param, pTxFrame, pRxFrame);
            Trace.WriteLine("iso14443AGetUID ret:" + ret.ToString());
            uid = "";
            if (ret > 0)
            {
                if (param.num > 0)
                {
                    string s = "";
                    for (int num4 = 0; num4 < protocol.HFREADER_ISO14443A_LEN_SIGNAL_UID; num4++)
                    {
                        s = s + param.uid[0].uid[num4].ToString("X").PadLeft(2, '0');
                    }
                    uid = s;
                }
            }
        }
コード例 #2
0
 public static extern int iso14443AGetUID(int h, ushort srcAddr, ushort targetAddr,
                                          byte mode, ref ISO14443A_UIDPARAM pUid,
                                          byte[] pTxFrame, byte[] pRxFrame);