Card.LunLi.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
baud int
kh string
ql int
money decimal
cs short
bkcs short
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)
        {
            int ret = -1;
            try
            {
                unsafe
                {                
                    byte[] s_companycode = new byte[10];
                    int cardtype = 0;
                    byte[] keycode = new byte[20];
                    byte* MeterID;
                    byte[] orderlsh = new byte[16];
                    double price = 0;
                    double totalmoney = 0;
                    int readflag = 0;
                    byte* userid;
                    int result = StaticReadCard((int)com, s_companycode, ref cardtype, keycode, out userid, out MeterID, orderlsh, ref price, ref totalmoney, ref readflag);
                   
                    string meterid = "";
                    while (*userid != 0)
                    {
                        kh += Convert.ToChar(*userid++);
                    }

                    while (*MeterID != 0)
                    {
                        meterid += Convert.ToChar(*MeterID++);

                    }
                    Log.Debug("卡号:" + kh + "---金额:" + totalmoney + "--表型:" + cardtype + "---表号:" + meterid);
                }
               
            }
            catch (Exception e)
            {
                Log.Debug("读卡异常:" + e.StackTrace + "----" + e.Message);
            }

            return ret;
        }