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.

41 lines
1.3 KiB

using BatCharging.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatCharging.Service
{
/// <summary>
/// 解析充电机上报模块状态
/// </summary>
public class MsgUpModelStationDecoder
{
/// <summary>
/// 解析充电机上报模块状态
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public UpModelStation GetMsgUpModelStation(byte[] data)
{
UpModelStation upModelStation = null;
if (data.Count() >= 35)
{
upModelStation= new UpModelStation();
upModelStation.ModelStation1 = data[25];
upModelStation.ModelStation2 = data[26];
upModelStation.ModelStation3 = data[27];
upModelStation.ModelStation4 = data[28];
upModelStation.ModelStation5 = data[29];
upModelStation.ModelStation6 = data[30];
upModelStation.ModelStation7 = data[31];
upModelStation.ModelStation8 = data[32];
upModelStation.ModelStation9 = data[33];
upModelStation.ModelStation10 = data[34];
}
return upModelStation;
}
}
}