You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BatCharging.Model;
namespace BatCharging.Service
{
/// <summary>
/// 4.2.12 解析充放电机应答版本号
/// </summary>
public class MsgAnsVerNumDecoder
{
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public AnsVerNum GetMsgAnsVerNum(byte[] data)
{
AnsVerNum ansVerNum = null;
if (data.Count() >= 34)
{
ansVerNum = new AnsVerNum();
ansVerNum.SofVerNum1 = data[25];
ansVerNum.SofVerNum2 = data[26];
ansVerNum.SofVerNum3 = data[27];
ansVerNum.HarVerNum1 = data[28];
ansVerNum.HarVerNum2 = data[29];
ansVerNum.HarVerNum3 = data[30];
ansVerNum.reserved1 = data[31];
ansVerNum.reserved2 = data[32];
ansVerNum.reserved3 = data[33];
}
return ansVerNum;
}
}
}