xianchang cehis xiugai

master
lxw 6 months ago
parent f6dcbeb218
commit a8b043634b

@ -254,11 +254,11 @@ public class RfidReadWriteTool
strTemps = strResult.Split(';'); strTemps = strResult.Split(';');
if (strTemps.Length >= 2) if (strTemps.Length >= 4)
{ {
if (strTemps[1] != "") if (strTemps[3] != "")
{ {
byte[] bytesVelNo = ToByteByHexStr(strTemps[1]); byte[] bytesVelNo = ToByteByHexStr(strTemps[3]);
Encoding gbEcoding = Encoding.GetEncoding("gb2312"); Encoding gbEcoding = Encoding.GetEncoding("gb2312");
strVelNo = gbEcoding.GetString(bytesVelNo); strVelNo = gbEcoding.GetString(bytesVelNo);
} }
@ -274,7 +274,7 @@ public class RfidReadWriteTool
{ {
Result = 1, Result = 1,
VelVin = strTemps[0], VelVin = strTemps[0],
VelNo = strVelNo, VelNo = strVelNo.Replace(";",""),
}; };
} }
} }

@ -21,7 +21,6 @@ public class RfidServer: IDisposable
private static MultithreadEventLoopGroup? workerGroup; private static MultithreadEventLoopGroup? workerGroup;
private static ServerBootstrap? bootstrap; private static ServerBootstrap? bootstrap;
private int _port = 9000;
public LogLevel? LogLevel { get; set; } public LogLevel? LogLevel { get; set; }
@ -58,9 +57,10 @@ public class RfidServer: IDisposable
{ {
InitBootstrap(); InitBootstrap();
} }
RfidMgr.Connect();
IChannel channel = bootstrap.BindAsync(_port).Result; IChannel channel = bootstrap.BindAsync(port).Result;
Log.Info($"server listen {_port}"); Log.Info($"server listen {port}");
} }
public void Dispose() public void Dispose()

Loading…
Cancel
Save