|
|
@ -47,21 +47,16 @@ namespace BatCharging.Service
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD1.value1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD1.value1));
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD1.value2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD1.value2));
|
|
|
|
lstContent.Add(CMD1.value3);
|
|
|
|
lstContent.Add(CMD1.value3);
|
|
|
|
lstContent.AddRange(ByteUtils.Int32ToByteArray((int)CMD1.value4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD1.value4));
|
|
|
|
|
|
|
|
lstContent.Add(CMD1.value5);
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD1.value6));
|
|
|
|
if (CMD1.value3 == 1)
|
|
|
|
if (CMD1.value3 == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lstContent.Add(CMD1.value5);
|
|
|
|
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD1.value6));
|
|
|
|
|
|
|
|
lstContent.AddRange(CMD1.value7);
|
|
|
|
lstContent.AddRange(CMD1.value7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,18 +99,14 @@ namespace BatCharging.Service
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD.value1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value1));
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD.value2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value2));
|
|
|
|
lstContent.Add(CMD.value3);
|
|
|
|
lstContent.Add(CMD.value3);
|
|
|
|
lstContent.AddRange(ByteUtils.Int32ToByteArray((int)CMD.value4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value5));
|
|
|
|
if (CMD.value3 == 1)
|
|
|
|
if (CMD.value3 == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lstContent.AddRange(ByteUtils.Int16ToByteArray((short)CMD.value5));
|
|
|
|
|
|
|
|
lstContent.AddRange(CMD.value6);
|
|
|
|
lstContent.AddRange(CMD.value6);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,8 +124,6 @@ namespace BatCharging.Service
|
|
|
|
model.CMD = 5;
|
|
|
|
model.CMD = 5;
|
|
|
|
model.checksumDomain = 0x01;
|
|
|
|
model.checksumDomain = 0x01;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.dataDomain = GetRCMD5DataInfo(cMD5); //数据域
|
|
|
|
model.dataDomain = GetRCMD5DataInfo(cMD5); //数据域
|
|
|
|
model.LengthDomain = Convert.ToUInt16(9 + model.dataDomain.Length); //报文长度
|
|
|
|
model.LengthDomain = Convert.ToUInt16(9 + model.dataDomain.Length); //报文长度
|
|
|
|
|
|
|
|
|
|
|
@ -163,11 +152,8 @@ namespace BatCharging.Service
|
|
|
|
lstContent.Add(CMD.value3);
|
|
|
|
lstContent.Add(CMD.value3);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
|
|
|
|
lstContent.Add(CMD.value5);
|
|
|
|
lstContent.Add(CMD.value5);
|
|
|
|
if (CMD.value3 == 1)
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value6));
|
|
|
|
{
|
|
|
|
lstContent.AddRange(CMD.value7);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
|
|
|
|
|
|
|
|
lstContent.AddRange(CMD.value7);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
|