From 1e79ceba4bddfcf877e353b9e8d5aa469ade35f1 Mon Sep 17 00:00:00 2001 From: rszn <645583145@qq.com> Date: Thu, 13 Jun 2024 18:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=9F=E5=A7=8B=E6=8A=A5?= =?UTF-8?q?=E6=96=87=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Car/Codec/Decoder.cs | 3 ++- Service/Car/Codec/Encoder.cs | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Service/Car/Codec/Decoder.cs b/Service/Car/Codec/Decoder.cs index a8dc698..66b6896 100644 --- a/Service/Car/Codec/Decoder.cs +++ b/Service/Car/Codec/Decoder.cs @@ -114,4 +114,5 @@ public class Decoder : ByteToMessageDecoder return -1; } -} \ No newline at end of file +} + diff --git a/Service/Car/Codec/Encoder.cs b/Service/Car/Codec/Encoder.cs index ea80435..e8319eb 100644 --- a/Service/Car/Codec/Encoder.cs +++ b/Service/Car/Codec/Encoder.cs @@ -1,6 +1,7 @@ using DotNetty.Buffers; using DotNetty.Codecs; using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Utils; using log4net; using Service.Car.Common; using Service.Car.Msg; @@ -8,14 +9,14 @@ using Service.Car.Msg; namespace Service.Car.Codec; /// -/// +/// /// public class Encoder : MessageToByteEncoder { private static readonly ILog Log = LogManager.GetLogger(typeof(Encoder)); /// - /// + /// /// /// /// @@ -25,6 +26,8 @@ public class Encoder : MessageToByteEncoder byte[] bytes = obj.ToBytes(); List list = new List(bytes); list.AddRange(CarConst.EndChar); - output.WriteBytes(list.ToArray()); + byte[] result = list.ToArray(); + Log.Info($"send {BitUtls.BytesToHexStr(result)}"); + output.WriteBytes(result); } -} \ No newline at end of file +}