示例#1
0
 /// <summary>
 /// 初始化读卡器
 /// </summary>
 /// <returns></returns>
 public bool Init()
 {
     try
     {
         icdev = CardReader.rf_init(0, 115200);// 初始化串口
         if ((int)icdev < 0)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        public string GetCardId()
        {
            int   st         = -1;     //操作结果标识
            ulong TagType    = 0x0004; //卡片类型M1卡 52428
            ulong tempcardId = 0;


            st = CardReader.rf_request(icdev, 1, out TagType);

            if (st != 0)
            {
                // throw new Exception("寻卡请求失败");
            }
            st = CardReader.rf_card(icdev, 1, ref tempcardId);
            if (st != 0)
            {
                return("");
            }
            else
            {
                return(ConvertCardSn(tempcardId));
            }
        }
示例#3
0
 public void Beep()
 {
     int i = CardReader.rf_beep((int)icdev, 20);
 }