diff --git a/HybirdFrameworkCore/Utils/BitUtls.cs b/HybirdFrameworkCore/Utils/BitUtls.cs index eaf751b..ba47b50 100644 --- a/HybirdFrameworkCore/Utils/BitUtls.cs +++ b/HybirdFrameworkCore/Utils/BitUtls.cs @@ -53,7 +53,7 @@ public static class BitUtls if (propertyType == STRING) { - return Convert.ChangeType(Encoding.ASCII.GetString(bytes, start, length), propertyType); + return Convert.ChangeType(Encoding.ASCII.GetString(bytes, start, length/8), propertyType); } if (propertyType == BYTEARRAY) diff --git a/Service/Charger/Client/ClientMgr.cs b/Service/Charger/Client/ClientMgr.cs index 054e9df..7bc7243 100644 --- a/Service/Charger/Client/ClientMgr.cs +++ b/Service/Charger/Client/ClientMgr.cs @@ -31,6 +31,13 @@ public static class ClientMgr return o; } + /// + /// 通过channel获取client + /// + /// + /// + /// 获取不到,client则为空 + /// public static bool TryGetClient(IChannel channel, out string sn, out ChargerClient? client) { string? snt = ChannelUtils.GetAttr(channel, ChargerConst.ChargerSn);