using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BatCharging.Model;
namespace BatCharging.Service
{
///
/// 解包充电机应答站控鉴权认证的字节列表
///
public class MsgSignResDecoder
{
///
/// 解包充电机应答站控鉴权认证的字节列表
///
/// 接收到字节数组
/// 充电机应答的鉴权消息
public AuthRes GetAuthResMsg(byte[] msgRecv)
{
AuthRes msgResult = null;
if (msgRecv != null)
{
int num = msgRecv.Length;
if (num >= 29)
{
msgResult = new AuthRes
{
ConnSeq = ByteUtils.ToUInt16(msgRecv, 25),
AuthResult = msgRecv[27],
FailReason = msgRecv[28]
};
}
}
else
{
return null;
}
return msgResult;
}
}
}