Card.SiDaTe.ReadGasCard C# (CSharp) Метод

ReadGasCard() публичный Метод

读卡
public ReadGasCard ( short com, int baud, string &kh, int &ql, decimal &money, short &cs, short &bkcs, string &yhh ) : int
com short 串口号,从0开始
baud int 波特率
kh string 设备编号,10位字符
ql int 气量,卡上有气不能购气
money decimal 金额,按金额计算的卡,卡上有金额不能购气(未用)
cs short 购气次数,以卡上购气次数为准。如果读不出,返回-1。返回-1后以数据库里为准
bkcs short 补卡次数,以卡上补卡次数为准。如果读不出,返回-1。返回-1后以数据库里为准(未用)
yhh string
Результат int
        public int ReadGasCard(short com, int baud, ref string kh, ref int ql, ref decimal money, ref short cs, ref short bkcs, ref string yhh)
        {
            Log.Debug("com:" + com + "," + "baud:" + baud + "," + "kh" + kh + "," + "ql:" + ql + "," + "money:" + money + "," + "cs:" + cs + "," + "bkcs:" + bkcs + "," + "yhh:" + yhh);
            kh = "";
            ql = 0;
            int BuyTimes = 0;
            Int16 CardState = 0;
            Int16 DevT = 0;
            Int16 IsInsert = 0;
            int icdev = auto_init(com, (UInt32)baud);  //打开设备
            if (icdev <= 0)
            {
                return -10;
            }
            StringBuilder sMeterNo = new StringBuilder(11);
            double dSumCharge = 0;
            int ret = DoReadUserCard2(icdev, sMeterNo, ref dSumCharge, ref BuyTimes, ref CardState, ref DevT, ref IsInsert);
            kh = sMeterNo.ToString().Trim();
            ql = (int)dSumCharge;
            cs = Convert.ToInt16(BuyTimes);
            Log.Debug("com:" + com + "," + "baud:" + baud + "," + "kh" + kh + "," + "ql:" + ql + "," + "money:" + money + "," + "cs:" + cs + "," + "bkcs:" + bkcs + "," + "yhh:" + yhh);
            ic_exit(icdev);
            return ret;
        }
        /// <summary>