/// <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; } }
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)); } }
public void Beep() { int i = CardReader.rf_beep((int)icdev, 20); }