예제 #1
0
 /// <summary>
 /// 获取ReportHeader
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public string GetReportHeader(byte[] data)
 {
     version    = Convert.ToInt32(data[0]);
     headLength = Convert.ToInt32(data[1]);
     bodyLength = GlobalClass.ByteToInt32(data, 2, 2);
     protocolID = Convert.ToInt32(data[4]);
     emiID      = Convert.ToInt32(data[5]);
     manuCode   = GlobalClass.ByteToInt32(data, 6, 2);
     return(GlobalClass.ByteToHex(data));
 }
예제 #2
0
파일: CEMI.cs 프로젝트: Test0222/Test02
 /// <summary>
 /// 获取CEMI
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public string GetCEMI(byte[] data)
 {
     mc         = Convert.ToInt32(data[0]);
     addLength  = Convert.ToInt32(data[1]);
     addInfo    = GlobalClass.ByteToHex(data, 2, addLength);
     ctrl1      = Convert.ToInt32(data[2 + addLength]);
     ctrl2      = Convert.ToInt32(data[3 + addLength]);
     srcAddress = GlobalClass.ByteToInt32(data, 4 + addLength, 2);
     desAddress = GlobalClass.ByteToInt32(data, 6 + addLength, 2);
     return(GlobalClass.ByteToHex(data));
 }