public void ParseData(byte[] Arr, int ArrLength, ref DLT698.FrameInfo gFrame) { bool flag = false; string text = string.Empty; string empty = string.Empty; int i = 0; checked { while (i < ArrLength) { if (!flag) { if (Arr[i] == 104) { flag = true; text = "68"; } } else { text += Arr[i].ToString("X2"); } //IL_56: i++; //continue; //goto IL_56; } this.FillStruct(text, ref gFrame); } }
private void FillStruct(string strValue, ref DLT698.FrameInfo gFrame) { checked { try { gFrame.Clear(); gFrame.L1 = this.GetDataLen(strValue.Substring(2, 4)).ToString(); this.GetControlField(strValue.Substring(12, 2), ref gFrame.DIR, ref gFrame.PRM, ref gFrame.FCB, ref gFrame.FCV, ref gFrame.CID); this.GetAddressField(strValue.Substring(14, 10), ref gFrame.A1, ref gFrame.A2, ref gFrame.MSA, ref gFrame.ArrFlag); gFrame.AFN = strValue.Substring(24, 2); this.GetSEQ(strValue.Substring(26, 2), ref gFrame.TpV, ref gFrame.FIR, ref gFrame.FIN, ref gFrame.CON, ref gFrame.PSEQ); int num = 0; if (gFrame.TpV == "1") { this.GetTimeFlag(strValue.Substring(strValue.Length - 16, 12), ref gFrame.PFC, ref gFrame.Time, ref gFrame.Delay); num = 12; } int num2 = 0; if (gFrame.FCB == "1") { gFrame.EC1 = strValue.Substring(strValue.Length - 18, 2); gFrame.EC2 = strValue.Substring(strValue.Length - 20, 2); num2 = 4; } int num3 = 28; while (num3 + 4 + num + num2 < strValue.Length) { string empty = string.Empty; string empty2 = string.Empty; string strValue2 = strValue.Substring(num3, 8); this.GetDataCellMark(strValue2, ref empty, ref empty2); gFrame.FN = gFrame.FN + empty + ","; gFrame.PN = gFrame.PN + empty2 + ","; num3 += 8; this.gDataLen.DoInfo(gFrame.AFN, empty, strValue.Substring(num3)); int dataLength = this.gDataLen.DataLength; gFrame.Data = gFrame.Data + strValue.Substring(num3, dataLength) + ","; num3 += dataLength; } gFrame.CS = strValue.Substring(strValue.Length - 4, 2); } catch { } } }