|
|
@ -58,10 +58,18 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ASDU asdu = Parse(buffer, totalFrameLength, out var data);
|
|
|
|
byte[]? data = null;
|
|
|
|
Log.Info($"receive {JsonConvert.SerializeObject(asdu)}:{data} from {ChannelUtils.GetAttr(context.Channel, ChargerConst.ChargerSn)}");
|
|
|
|
try
|
|
|
|
output.Add(asdu);
|
|
|
|
{
|
|
|
|
buffer.Clear();
|
|
|
|
ASDU asdu = Parse(buffer, totalFrameLength, out data);
|
|
|
|
|
|
|
|
Log.Info($"receive {JsonConvert.SerializeObject(asdu)}:{data} from {ChannelUtils.GetAttr(context.Channel, ChargerConst.ChargerSn)}");
|
|
|
|
|
|
|
|
output.Add(asdu);
|
|
|
|
|
|
|
|
buffer.Clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Error($"decode fail msg={BitUtls.BytesToHexStr(data)}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -244,4 +252,4 @@ public class Decoder : ByteToMessageDecoder
|
|
|
|
|
|
|
|
|
|
|
|
return asdu;
|
|
|
|
return asdu;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|