using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using BatCharging.Model; namespace BatCharging.Service { /// /// 3.4.2 充放电机应答站功率调节指令 /// public class PowerRegulateDecoder { /// /// 解包1 应答结果 BIN 1字节 0: 成功 1:失败 ///2 失败原因 BIN 1字节 0:正常 1:参数非法 2:双向充电设备放电中 0xFF:其他原因 /// /// 接收到字节数组 /// /returns> public PowerRegulateResult GetPowerRegulateResult(byte[] msgRecv) { PowerRegulateResult msgResult = null; if (msgRecv != null) { int num = msgRecv.Length; if (num >= 27) { msgResult = new PowerRegulateResult { ResponseResults = msgRecv[25], FailurReason = msgRecv[26], }; } } return msgResult; } } }