@ -7,6 +7,7 @@ using SlnMesnac.Model.dto;
using SlnMesnac.Repository.service ;
using SlnMesnac.Repository.service ;
using SlnMesnac.Rfid.Dto ;
using SlnMesnac.Rfid.Dto ;
using SlnMesnac.Rfid.Enum ;
using SlnMesnac.Rfid.Enum ;
using SlnMesnac.Serilog ;
using SlnMesnac.TouchSocket ;
using SlnMesnac.TouchSocket ;
using System ;
using System ;
using System.Collections ;
using System.Collections ;
@ -44,14 +45,14 @@ namespace SlnMesnac.Rfid.Factory
{
{
public class RflyFactory : RfidAbsractFactory
public class RflyFactory : RfidAbsractFactory
{
{
private ILogger< RflyFactory > _logger ;
private SerilogHelper _logger ;
private readonly TcpClient _tcpClient = new TcpClient ( ) ;
private readonly TcpClient _tcpClient = new TcpClient ( ) ;
private readonly StringChange _stringChange ;
private readonly StringChange _stringChange ;
private string m_strIP ;
private string m_strIP ;
private string m_deviceID ;
private string m_deviceID ;
private MeshttpClient _meshttpClient ;
private MeshttpClient _meshttpClient ;
public RflyFactory ( ILogger< RflyFactory > logger , StringChange stringChange , MeshttpClient meshttpClient )
public RflyFactory ( SerilogHelper logger , StringChange stringChange , MeshttpClient meshttpClient )
{
{
_logger = logger ;
_logger = logger ;
_stringChange = stringChange ;
_stringChange = stringChange ;
@ -168,7 +169,7 @@ namespace SlnMesnac.Rfid.Factory
byte [ ] reciveBuffer = waitClient . SendThenReturn ( pMessagePack . m_pData , timeout ) ;
byte [ ] reciveBuffer = waitClient . SendThenReturn ( pMessagePack . m_pData , timeout ) ;
_logger . Log Information ( $"接收原始报文:{_stringChange.bytesToHexStr(reciveBuffer,reciveBuffer.Length)}" ) ;
_logger . Info( $"接收原始报文:{_stringChange.bytesToHexStr(reciveBuffer,reciveBuffer.Length)}" ) ;
byte [ ] resultBuffer = PareReceiveBufferData ( reciveBuffer , reciveBuffer . Length ) ;
byte [ ] resultBuffer = PareReceiveBufferData ( reciveBuffer , reciveBuffer . Length ) ;
@ -233,10 +234,10 @@ namespace SlnMesnac.Rfid.Factory
} ) ;
} ) ;
byte [ ] reciveBuffer = await waitClient . SendThenReturnAsync ( pMessagePack . m_pData , timeout ) ;
byte [ ] reciveBuffer = await waitClient . SendThenReturnAsync ( pMessagePack . m_pData , timeout ) ;
_logger . Log Information ( $"{m_deviceID}发送读取指令{_stringChange.bytesToHexStr(pMessagePack.m_pData,pMessagePack.m_pData.Length)}" ) ;
_logger . Info( $"{m_deviceID}发送读取指令{_stringChange.bytesToHexStr(pMessagePack.m_pData,pMessagePack.m_pData.Length)}" ) ;
byte [ ] resultBuffer = PareReceiveBufferData ( reciveBuffer , reciveBuffer . Length ) ;
byte [ ] resultBuffer = PareReceiveBufferData ( reciveBuffer , reciveBuffer . Length ) ;
_logger . Log Information ( $"{m_deviceID}接收读取指令{_stringChange.bytesToHexStr(resultBuffer,resultBuffer.Length)}" ) ;
_logger . Info( $"{m_deviceID}接收读取指令{_stringChange.bytesToHexStr(resultBuffer,resultBuffer.Length)}" ) ;
tagInfoList = Device_DealTagInfoList ( resultBuffer ) ;
tagInfoList = Device_DealTagInfoList ( resultBuffer ) ;
@ -378,10 +379,10 @@ namespace SlnMesnac.Rfid.Factory
return false ;
return false ;
}
}
} ) ;
} ) ;
_logger . Log Information ( $"{m_deviceID}发送修改功率指令{_stringChange.bytesToHexStr(pMessagePack.m_pData, pMessagePack.m_pData.Length)}" ) ;
_logger . Info( $"{m_deviceID}发送修改功率指令{_stringChange.bytesToHexStr(pMessagePack.m_pData, pMessagePack.m_pData.Length)}" ) ;
byte [ ] reciveBuffer = await waitClient . SendThenReturnAsync ( pMessagePack . m_pData , 2000 ) ;
byte [ ] reciveBuffer = await waitClient . SendThenReturnAsync ( pMessagePack . m_pData , 2000 ) ;
_logger . Log Information ( $"{m_deviceID}接收修改功率指令{_stringChange.bytesToHexStr(reciveBuffer, reciveBuffer.Length)}" ) ;
_logger . Info( $"{m_deviceID}接收修改功率指令{_stringChange.bytesToHexStr(reciveBuffer, reciveBuffer.Length)}" ) ;
//byte[] resultBuffer = PareReceiveBufferData(reciveBuffer, reciveBuffer.Length);
//byte[] resultBuffer = PareReceiveBufferData(reciveBuffer, reciveBuffer.Length);
if ( reciveBuffer [ 3 ] = = 0x42 )
if ( reciveBuffer [ 3 ] = = 0x42 )
@ -781,7 +782,7 @@ namespace SlnMesnac.Rfid.Factory
iFirstPC = iFirstAnt + 1 ;
iFirstPC = iFirstAnt + 1 ;
iFirstLeftBarcketPos = iFirstLeftBarcketPos + iBarcodeLength + 5 ;
iFirstLeftBarcketPos = iFirstLeftBarcketPos + iBarcodeLength + 5 ;
_logger . Log Information ( $"----{m_deviceID}函数调用:Device_DealTagInfoList 第[" + ( iCommonSecondFlag + 1 ) + "]次数据解析为:" + tag . EPCstring + ",读取标签次数:[" + tempDataCount + "],标签信号强度:[" + tempDataRSSI + "],天线号:[" + tempDataANT + "]" ) ;
_logger . Info( $"----{m_deviceID}函数调用:Device_DealTagInfoList 第[" + ( iCommonSecondFlag + 1 ) + "]次数据解析为:" + tag . EPCstring + ",读取标签次数:[" + tempDataCount + "],标签信号强度:[" + tempDataRSSI + "],天线号:[" + tempDataANT + "]" ) ;
iCommonSecondFlag + + ;
iCommonSecondFlag + + ;
if ( iCommonSecondFlag = = iBarcodeGroupCount )
if ( iCommonSecondFlag = = iBarcodeGroupCount )
{
{