using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DotNetty.Buffers; using HybirdFrameworkServices.ChargerManage.Msg; /** * (CMD=206)充电桩上传用户密码验证报文(预留) */ namespace HybirdFrameworkServices { public class CMD206 : BaseMsg { public CMD206() { } //调用父类的构造函数 public CMD206(IByteBuffer byteBuffer,string clientIp) : base(byteBuffer,clientIp) { } public override void ParseBody() { this.Reserved1=this.ByteBuffer.GetUnsignedShortLE(BaseMsg.StartBodyIndex); this.Reserved2=this.ByteBuffer.GetUnsignedShortLE(BaseMsg.StartBodyIndex+2); ByteBuffer.SetReaderIndex(12); // 读取接下来的32字节 byte[] no = new byte[32]; ByteBuffer.ReadBytes(no); this.ASCIINum = Encoding.ASCII.GetString(no); no = new byte[32]; ByteBuffer.ReadBytes(no); this.ChargID = Encoding.ASCII.GetString(no); no = new byte[32]; ByteBuffer.ReadBytes(no); this.ChargPassword = Encoding.ASCII.GetString(no); no = new byte[48]; ByteBuffer.ReadBytes(no); this.RandomData = Encoding.ASCII.GetString(no); } /// /// 预留 /// public ushort Reserved1 { get; set; } /// /// 预留 /// public ushort Reserved2 { get; set; } /// /// 充电桩编码 /// public string ASCIINum { get; set; } /// /// 充电卡号 /// public string ChargID { get; set; } /// /// 用户充电密码 /// public string ChargPassword { get; set; } /// /// 卡扇区数据随机数 /// public string RandomData { get; set; } } }