|
|
|
@ -124,8 +124,8 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
|
|
|
|
|
|
int removeIndex = delimiter.Capacity;
|
|
|
|
|
|
|
|
|
|
ushort cmd = byteBuffer.GetByte(14 + removeIndex);
|
|
|
|
|
ushort recordType = byteBuffer.GetByte(23 + removeIndex);
|
|
|
|
|
ushort cmd =data[14 + removeIndex];
|
|
|
|
|
ushort recordType = data[23 + removeIndex];
|
|
|
|
|
byte[] bytes = new byte[data.Length - (23 + removeIndex)];
|
|
|
|
|
Array.Copy(data, 23 + removeIndex, bytes, 0, bytes.Length);
|
|
|
|
|
ASDU asdu = cmd switch
|
|
|
|
@ -248,7 +248,7 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
|
|
|
|
|
|
_ => new ASDU()
|
|
|
|
|
};
|
|
|
|
|
ASDU.ParseHeader(byteBuffer, asdu);
|
|
|
|
|
ASDU.ParseHeader(data, asdu);
|
|
|
|
|
|
|
|
|
|
return asdu;
|
|
|
|
|
}
|
|
|
|
|