public int CheckGasCard(short com, int baud)
{
int rs = -1;
try
{
PLtCardReader pcr1 = new PLtCardReader()
{
dwDevType = 2,
dwPort = com,
dwBaud = baud,
dv_beep = 0
};
PUserCard puc1 = new PUserCard();
int istrue = 0;
Log.Debug("LanBaoShiGY CheckGasCard start");
rs = CheckLibrary(ref pcr1, ref puc1, ref istrue);
Log.Debug("LanBaoShiGY CheckGasCard end,return:" + rs);
if (1 == istrue)
{
int pti = 0;
Log.Debug("LanBaoShiGY ReadGasCard start");
rs = ReadUserCard(ref pcr1, ref puc1, pti);
Log.Debug("LanBaoShiGY ReadGasCard end,return:" + rs);
if (puc1.MecMeterType == 1)
{
Log.Debug("此卡是蓝宝石工业卡!");
return 0;
}
Log.Debug("此卡不是蓝宝石工业卡!");
return -1;
}
Log.Debug("此卡不是蓝宝石工业卡!");
return -1;
}
catch(Exception e)
{
Log.Debug("蓝宝石工业判卡异常:" + e.Message + "--" + e.StackTrace);
}
return rs;
}