Logging extended with slot, prepared for hiding of sensible data in log-file (e.g. needed for encryption key)
This commit is contained in:
@@ -20,11 +20,11 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
|
|
||||||
public abstract void SetDefaultResponseTimeout();
|
public abstract void SetDefaultResponseTimeout();
|
||||||
|
|
||||||
public abstract List<Byte> DecodeDataForPhysicalLayer(Byte command, Byte[] payload, Boolean hideDateInLog = false);
|
public abstract List<Byte> DecodeDataForPhysicalLayer(String ident, Byte command, Byte[] payload, Boolean hideDataInLog = false);
|
||||||
|
|
||||||
public abstract List<Byte> DecodeDataForLogicLayer(List<Byte> rawData);
|
public abstract List<Byte> DecodeDataForLogicLayer(String ident, List<Byte> rawData, Boolean hideDataInLog = false);
|
||||||
|
|
||||||
public abstract List<Byte> DecodeDataForPhysicalLayerUI1236(Byte[] payload);
|
public abstract List<Byte> DecodeDataForPhysicalLayerUI1236(String ident, Byte[] payload, Boolean hideDataInLog = false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,16 +23,16 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
void SetDefaultResponseTimeout();
|
void SetDefaultResponseTimeout();
|
||||||
|
|
||||||
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
||||||
List<Byte> DecodeDataForPhysicalLayerUI1236(Byte[] payload);
|
List<Byte> DecodeDataForPhysicalLayerUI1236(String ident, Byte[] payload, Boolean hideDataInLog = false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send out data (including transport protocol specific data like CRC) to physical port (like UART or IrDA)
|
/// Send out data (including transport protocol specific data like CRC) to physical port (like UART or IrDA)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
List<Byte> DecodeDataForPhysicalLayer(Byte command , Byte[] payload, Boolean hideDateInLog = false);
|
List<Byte> DecodeDataForPhysicalLayer(String ident, Byte command , Byte[] payload, Boolean hideDataInLog = false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Received data have to be checked and converted to request protocol
|
/// Received data have to be checked and converted to request protocol
|
||||||
/// </summary>
|
/// </summary>
|
||||||
List<Byte> DecodeDataForLogicLayer(List<Byte> rawData);
|
List<Byte> DecodeDataForLogicLayer(String ident, List<Byte> rawData, Boolean hideDateInLog = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,9 +90,15 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
/// - Wakeup message detection reported to log-file,
|
/// - Wakeup message detection reported to log-file,
|
||||||
/// - Message error text changed.
|
/// - Message error text changed.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override List<Byte> DecodeDataForLogicLayer(List<Byte> irdaRecord)
|
/// <remarks date="2023-Sep-01" author="T.Wiedebusch">
|
||||||
|
/// - Hide data in log introduced.
|
||||||
|
/// </remarks>
|
||||||
|
public override List<Byte> DecodeDataForLogicLayer(String ident, List<Byte> irdaRecord, Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
Logger.Info($"DecodeDataForPhysicalLayer Cordonel->PC({BitConverter.ToString(irdaRecord.ToArray())})");
|
// avoid logging of passwords or other sensitive data
|
||||||
|
Logger.Info(hideDataInLog
|
||||||
|
? $"{ident} DecodeDataForLogicalLayer Cordonel->PC(*****)"
|
||||||
|
: $"{ident} DecodeDataForLogicalLayer Cordonel->PC({BitConverter.ToString(irdaRecord.ToArray())})");
|
||||||
|
|
||||||
// check the record length and start of frame information
|
// check the record length and start of frame information
|
||||||
if (irdaRecord.Count < IrdaProtocolFrameLength + irdaRecord[IrdaPayLoadLengthIndex]
|
if (irdaRecord.Count < IrdaProtocolFrameLength + irdaRecord[IrdaPayLoadLengthIndex]
|
||||||
@@ -102,7 +108,7 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
|| ((irdaRecord[IrdaMessageIndex] != IrdaMessageId)
|
|| ((irdaRecord[IrdaMessageIndex] != IrdaMessageId)
|
||||||
&& irdaRecord[IrdaMessageIndex] != IrdaWakeupId)))
|
&& irdaRecord[IrdaMessageIndex] != IrdaWakeupId)))
|
||||||
{
|
{
|
||||||
var error = new ApplicationException("Reply from IrDA is invalid.");
|
var error = new ApplicationException($"{ident} Reply from IrDA is invalid.");
|
||||||
Logger.Error(error.Message, error);
|
Logger.Error(error.Message, error);
|
||||||
|
|
||||||
return new List<Byte>();
|
return new List<Byte>();
|
||||||
@@ -123,7 +129,7 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
|
|
||||||
if (receivedCrc != calculatedCrc)
|
if (receivedCrc != calculatedCrc)
|
||||||
{
|
{
|
||||||
var error = new ApplicationException("Reply CRC failure. Decoding of transmit layer failed.");
|
var error = new ApplicationException($"{ident} Reply CRC failure. Decoding of transmit layer failed.");
|
||||||
Logger.Error(error.Message, error);
|
Logger.Error(error.Message, error);
|
||||||
return new List<Byte>();
|
return new List<Byte>();
|
||||||
}
|
}
|
||||||
@@ -142,8 +148,8 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
/// <remarks date="2023-Mai-16" author="T.Wiedebusch">
|
/// <remarks date="2023-Mai-16" author="T.Wiedebusch">
|
||||||
/// - Hide data in log forwarded to DecodeDateForPhysicalLayer to hide passwords in log files.
|
/// - Hide data in log forwarded to DecodeDateForPhysicalLayer to hide passwords in log files.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override List<Byte> DecodeDataForPhysicalLayer(Byte requestProtocolCommand, Byte[] requestProtocolPayload,
|
public override List<Byte> DecodeDataForPhysicalLayer(String ident, Byte requestProtocolCommand, Byte[] requestProtocolPayload,
|
||||||
Boolean hideDateInLog = false)
|
Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
var irdaCrcInputBuffer = new List<Byte>
|
var irdaCrcInputBuffer = new List<Byte>
|
||||||
{
|
{
|
||||||
@@ -170,9 +176,9 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
irdaRecord.Add((Byte)(crcResult >> 8));
|
irdaRecord.Add((Byte)(crcResult >> 8));
|
||||||
|
|
||||||
// avoid logging of passwords or other sensitive data
|
// avoid logging of passwords or other sensitive data
|
||||||
Logger.Info(hideDateInLog
|
Logger.Info(hideDataInLog
|
||||||
? "DecodeDataForPhysicalLayer PC->Cordonel(*******************)"
|
? $"{ident} DecodeDataForPhysicalLayer PC->Cordonel(*****)"
|
||||||
: $"DecodeDataForPhysicalLayer PC->Cordonel({BitConverter.ToString(irdaRecord.ToArray())})");
|
: $"{ident} DecodeDataForPhysicalLayer PC->Cordonel({BitConverter.ToString(irdaRecord.ToArray())})");
|
||||||
|
|
||||||
return irdaRecord;
|
return irdaRecord;
|
||||||
}
|
}
|
||||||
@@ -181,7 +187,8 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
||||||
/// - Initial
|
/// - Initial
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override List<Byte> DecodeDataForPhysicalLayerUI1236(Byte[] requestProtocolPayload)
|
public override List<Byte> DecodeDataForPhysicalLayerUI1236(String ident, Byte[] requestProtocolPayload,
|
||||||
|
Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
var collection = new List<Byte>
|
var collection = new List<Byte>
|
||||||
{
|
{
|
||||||
@@ -197,7 +204,10 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
byteList.AddRange(collection);
|
byteList.AddRange(collection);
|
||||||
byteList.Add((Byte)(crcResult & 0xFF));
|
byteList.Add((Byte)(crcResult & 0xFF));
|
||||||
byteList.Add((Byte)(crcResult >> 8));
|
byteList.Add((Byte)(crcResult >> 8));
|
||||||
Logger.Info("DecodeDataForPhysicalLayerUI1236 PC->Cordonel(" + BitConverter.ToString(byteList.ToArray()) + ")");
|
// avoid logging of passwords or other sensitive data
|
||||||
|
Logger.Info(hideDataInLog
|
||||||
|
? $"{ident} DecodeDataForPhysicalLayerUI1236 PC->Cordonel(*****)"
|
||||||
|
: $"{ident} DecodeDataForPhysicalLayerUI1236 PC->Cordonel({BitConverter.ToString(byteList.ToArray())})");
|
||||||
return byteList;
|
return byteList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,17 +37,18 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override List<Byte> DecodeDataForPhysicalLayer(Byte command, Byte[] payload, Boolean hideDateInLog = false)
|
public override List<Byte> DecodeDataForPhysicalLayer(String ident, Byte command, Byte[] payload, Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
throw new ApplicationException("Streaming port cannot send data");
|
throw new ApplicationException("Streaming port cannot send data");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override List<Byte> DecodeDataForLogicLayer(List<Byte> rawData)
|
public override List<Byte> DecodeDataForLogicLayer(String ident, List<Byte> rawData, Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
return rawData;
|
return rawData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<Byte> DecodeDataForPhysicalLayerUI1236(Byte[] payload) => throw new ApplicationException("Streaming port cannot send data");
|
public override List<Byte> DecodeDataForPhysicalLayerUI1236(String ident, Byte[] payload, Boolean hideDataInLog = false)
|
||||||
|
=> throw new ApplicationException("Streaming port cannot send data");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
_responseTimeoutMs, BaudRate, _receiveBufferFlushThreshold, UartDoubleSyncByte);
|
_responseTimeoutMs, BaudRate, _receiveBufferFlushThreshold, UartDoubleSyncByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<Byte> DecodeDataForLogicLayer(List<Byte> uartRecord)
|
public override List<Byte> DecodeDataForLogicLayer(String ident, List<Byte> uartRecord, Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
// check the record length and start of frame information
|
// check the record length and start of frame information
|
||||||
if (uartRecord.Count < uartRecord[UartLengthIndex] + UartSyncByteLength
|
if (uartRecord.Count < uartRecord[UartLengthIndex] + UartSyncByteLength
|
||||||
|| UartSyncByte != uartRecord[UartSyncByteIndex])
|
|| UartSyncByte != uartRecord[UartSyncByteIndex])
|
||||||
{
|
{
|
||||||
var error = new ApplicationException("Reply from UART is invalid. Decoding of transmit layer failed.");
|
var error = new ApplicationException($"{ident} Reply from UART is invalid. Decoding of transmit layer failed.");
|
||||||
Logger.Error(error.Message, error);
|
Logger.Error(error.Message, error);
|
||||||
return new List<Byte>();
|
return new List<Byte>();
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
|
|
||||||
if(receivedCrc != calculatedCrc)
|
if(receivedCrc != calculatedCrc)
|
||||||
{
|
{
|
||||||
var error = new ApplicationException("Reply CRC failure. Decoding of transmit layer failed.");
|
var error = new ApplicationException($"{ident} Reply CRC failure. Decoding of transmit layer failed.");
|
||||||
Logger.Error(error.Message, error);
|
Logger.Error(error.Message, error);
|
||||||
return new List<Byte>();
|
return new List<Byte>();
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override List<Byte> DecodeDataForPhysicalLayer(Byte requestProtocolCommand,
|
public override List<Byte> DecodeDataForPhysicalLayer(String ident, Byte requestProtocolCommand,
|
||||||
Byte[] requestProtocolPayload, Boolean hideDataInLog = false)
|
Byte[] requestProtocolPayload, Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
var uartHeader = new List<Byte>();
|
var uartHeader = new List<Byte>();
|
||||||
@@ -148,7 +148,8 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
|
|||||||
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
||||||
/// - Initial
|
/// - Initial
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override List<Byte> DecodeDataForPhysicalLayerUI1236(Byte[] requestProtocolPayload)
|
public override List<Byte> DecodeDataForPhysicalLayerUI1236(String ident, Byte[] requestProtocolPayload,
|
||||||
|
Boolean hideDataInLog = false)
|
||||||
{
|
{
|
||||||
var uartHeader = new List<Byte>();
|
var uartHeader = new List<Byte>();
|
||||||
var uartPayload = requestProtocolPayload.ToList();
|
var uartPayload = requestProtocolPayload.ToList();
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
actualRegister.DataType = typeof(UInt96);
|
actualRegister.DataType = typeof(UInt96);
|
||||||
break;
|
break;
|
||||||
case "int8_t":
|
case "int8_t":
|
||||||
actualRegister.DataType = typeof(sbyte);
|
actualRegister.DataType = typeof(SByte);
|
||||||
break;
|
break;
|
||||||
case "int32_t":
|
case "int32_t":
|
||||||
actualRegister.DataType = typeof(Int32);
|
actualRegister.DataType = typeof(Int32);
|
||||||
|
|||||||
@@ -1313,7 +1313,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
//avoid overwriting of list if this already exits
|
//avoid overwriting of list if this already exits
|
||||||
if (MeterAppListVersion.Any())
|
if (MeterAppListVersion.Any())
|
||||||
{
|
{
|
||||||
_logger.Warn("Trying to override meter dictionary. Skip read out FW");
|
_logger.Warn($"Slot:{Slot} - Trying to override meter dictionary. Skip read out FW");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1393,29 +1393,29 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
//log application information to file
|
//log application information to file
|
||||||
_logger.Info($"PCB ID: {PcbId}");
|
_logger.Info($"Slot:{Slot} - PCB ID: {PcbId}");
|
||||||
_logger.Info($"Date time (UTC): {DateTimeOffset.UtcNow}");
|
_logger.Info($"Slot:{Slot} - Date time (UTC): {DateTimeOffset.UtcNow}");
|
||||||
if (CoreRevision != null)
|
if (CoreRevision != null)
|
||||||
{
|
{
|
||||||
_logger.Info("System Core Revision: " + BuildFwVersionString(CoreRevision));
|
_logger.Info($"Slot:{Slot} - System Core Revision: {BuildFwVersionString(CoreRevision)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info("Region: " + Region);
|
_logger.Info($"Slot:{Slot} - Region: {Region}");
|
||||||
|
|
||||||
if (RadioFrequencyMhz != null)
|
if (RadioFrequencyMhz != null)
|
||||||
{
|
{
|
||||||
_logger.Info($"Radio frequency [MHz]: {RadioFrequencyMhz}");
|
_logger.Info($"Slot:{Slot} - Radio frequency [MHz]: {RadioFrequencyMhz}");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var fm in MeterAppListVersion.OrderBy(o => o.AppId))
|
foreach (var fm in MeterAppListVersion.OrderBy(o => o.AppId))
|
||||||
{
|
{
|
||||||
var versionString = fm.IsInstalled
|
var versionString = fm.IsInstalled
|
||||||
? $"V: {fm.StrVersion} - CRC: 0x{fm.Crc:X4}" : "Not installed";
|
? $"V: {fm.StrVersion} - CRC: 0x{fm.Crc:X4}" : "Not installed";
|
||||||
_logger.Info($"AppId: 0x{fm.AppId:X2} - {versionString} - AppName: {fm.AppName}");
|
_logger.Info($"Slot:{Slot} - AppId: 0x{fm.AppId:X2} - {versionString} - AppName: {fm.AppName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info($"Meter size: {MeterSize}");
|
_logger.Info($"Slot:{Slot} - Meter size: {MeterSize}");
|
||||||
_logger.Info($"Upgrade permission: {MetrologyUpgradePermission:X2}");
|
_logger.Info($"Slot:{Slot} - Upgrade permission: {MetrologyUpgradePermission:X2}");
|
||||||
//remove unused registers with invalid version
|
//remove unused registers with invalid version
|
||||||
var tempConfigRegisters = _configRegister.MeterRegisterDic.ToList();
|
var tempConfigRegisters = _configRegister.MeterRegisterDic.ToList();
|
||||||
|
|
||||||
@@ -1460,7 +1460,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
_logger.Warn(ex, $"Not able to set minimum list of registers. check json file for {checkMinRegister} ");
|
_logger.Warn(ex, $"Slot:{Slot} - Not able to set minimum list of registers. check json file for {checkMinRegister} ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1871,7 +1871,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.Error(e);
|
_logger.Error($"Slot:{Slot} - {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -1912,7 +1912,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.Error(e);
|
_logger.Error($"Slot:{Slot} - {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -1962,10 +1962,12 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
/// - Initial
|
/// - Initial
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
||||||
public Byte[] SendUI1236Command(Byte[] ui1236Frame, Boolean waitForResult = true, Boolean checkRegister = false, UInt16 skipRetryErrorCode = 4)
|
public Byte[] SendUI1236Command(Byte[] ui1236Frame, Boolean waitForResult = true, Boolean checkRegister = false,
|
||||||
|
UInt16 skipRetryErrorCode = 4)
|
||||||
{
|
{
|
||||||
_logger.Info($"Slot:{Slot} - Sending Ui-1236 frame: {ui1236Frame} ");
|
var requestIdent = $"Slot:{Slot} - Sending Ui-1236 frame";
|
||||||
var sendFifoUi1236 = RequestProtocol.AddRecordToSendFifoUI1236(ui1236Frame);
|
_logger.Info(requestIdent);
|
||||||
|
var sendFifoUi1236 = RequestProtocol.AddRecordToSendFifoUI1236(requestIdent, ui1236Frame);
|
||||||
RequestProtocolProcess();
|
RequestProtocolProcess();
|
||||||
return sendFifoUi1236.ResponsePayload.ToArray();
|
return sendFifoUi1236.ResponsePayload.ToArray();
|
||||||
}
|
}
|
||||||
@@ -2051,16 +2053,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
public void WriteLog(String text)
|
public void WriteLog(String text)
|
||||||
{
|
{
|
||||||
_logger.Info($"Slot:{Slot} - {text}");
|
_logger.Info($"Slot:{Slot} - {text}");
|
||||||
//if (_enableRawDataLogging)
|
|
||||||
//{
|
|
||||||
// if (_loggerRawData == null)
|
|
||||||
// {
|
|
||||||
// _loggerRawData = NLogHelper.CreateOrGetMultiLogger(
|
|
||||||
// StreamingPort.GetPortName(), "", "LedRawData", "TargetLedRawDataBase", "LedRawDataBase");
|
|
||||||
|
|
||||||
// }
|
|
||||||
// _loggerRawData.Info($"{text}");
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -2307,7 +2299,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex, "Can't store at RegisterWatchService");
|
_logger.Error($"Slot:{Slot} - {ex} - Can't store at RegisterWatchService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2337,13 +2329,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
_logger.Error(new Exception($"HTTP status not OK"),
|
_logger.Error(new Exception($"Slot:{Slot} - HTTP status not OK"),
|
||||||
"Can't store at RegisterWatchService");
|
"Can't store at RegisterWatchService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex, "Can't store at RegisterWatchService");
|
_logger.Error($"Slot:{Slot} - {ex} - Can't store at RegisterWatchService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2384,12 +2376,12 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|||||||
|
|
||||||
if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.Accepted)
|
if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.Accepted)
|
||||||
{
|
{
|
||||||
_logger.Error(new Exception($"HTTP status not OK({response.StatusCode})"), "can not store at RegisterWatchService");
|
_logger.Error(new Exception($"Slot:{Slot} - HTTP status not OK({response.StatusCode})"), "can not store at RegisterWatchService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex, "can not store at RegisterWatchService");
|
_logger.Error($"Slot:{Slot} - {ex} - can not store at RegisterWatchService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public RequestAcknowledgeState ProcessRecordList()
|
public RequestAcknowledgeState ProcessRecordList()
|
||||||
{
|
{
|
||||||
_logger.Trace($" Enry to ProcessRecordList, FIFO contains ({_recordsSendFifo.Count}) records");
|
_logger.Trace($"{_ident} Entry to ProcessRecordList, FIFO contains ({_recordsSendFifo.Count}) records");
|
||||||
|
|
||||||
//The inter record send delay has to be hold before trying to communicate again
|
//The inter record send delay has to be hold before trying to communicate again
|
||||||
const Int32 interRecordSendDelayMs = CommunicationConfig.InterRecordSendDelayMs;
|
const Int32 interRecordSendDelayMs = CommunicationConfig.InterRecordSendDelayMs;
|
||||||
@@ -188,27 +188,28 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
{
|
{
|
||||||
// Starting with record number 1
|
// Starting with record number 1
|
||||||
loopCounter++;
|
loopCounter++;
|
||||||
_logger.Trace($"Record({loopCounter}) - Dequeued from FIFO");
|
_logger.Trace($"{_ident} Record({loopCounter}) - Dequeued from FIFO");
|
||||||
|
|
||||||
//pointer to new record
|
//pointer to new record
|
||||||
_recordInProcess = internalRecord;
|
_recordInProcess = internalRecord;
|
||||||
if (_recordInProcess == null) return RequestAcknowledgeState.CommandNotAssigned;
|
if (_recordInProcess == null)
|
||||||
|
return RequestAcknowledgeState.CommandNotAssigned;
|
||||||
|
|
||||||
//mark record as answer outstanding
|
//mark record as answer outstanding
|
||||||
_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded;
|
_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
_logger.Trace($"Record({loopCounter}) - Processing");
|
_logger.Trace($"{_ident} Record({loopCounter}) - Processing");
|
||||||
//log retries
|
//log retries
|
||||||
if (_recordInProcess.RetryCtr > 0)
|
if (_recordInProcess.RetryCtr > 0)
|
||||||
{
|
{
|
||||||
_logger.Debug($"{_ident} Retry({_recordInProcess.RetryCtr})");
|
_logger.Debug($"{_ident} Retry({_recordInProcess.RetryCtr})");
|
||||||
_logger.Trace($"Record({loopCounter}) - Retry({_recordInProcess.RetryCtr})");
|
_logger.Trace($"{_ident} Record({loopCounter}) - Retry({_recordInProcess.RetryCtr})");
|
||||||
}
|
}
|
||||||
|
|
||||||
//log request protocol content
|
//log request protocol content
|
||||||
_logger.Debug(_recordInProcess.HideDataInLog
|
_logger.Debug(_recordInProcess.HideDataInLog
|
||||||
? $"{_ident} SentData(*********************************)"
|
? $"{_ident} SentData(*****)"
|
||||||
: $"{_ident} SentData({BitConverter.ToString(_recordInProcess.RequestProtocolData.ToArray())})");
|
: $"{_ident} SentData({BitConverter.ToString(_recordInProcess.RequestProtocolData.ToArray())})");
|
||||||
|
|
||||||
//remind time for keep-session-active test to deny automatic logout of meter
|
//remind time for keep-session-active test to deny automatic logout of meter
|
||||||
@@ -220,7 +221,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
CommunicationConfig.ResponseTimeoutMs * (_recordInProcess.RetryCtr + 1);
|
CommunicationConfig.ResponseTimeoutMs * (_recordInProcess.RetryCtr + 1);
|
||||||
//start initial communication or retry
|
//start initial communication or retry
|
||||||
OnRecordReadyToSend?.Invoke(this, new ListBytePortDataEventArgs(_recordInProcess.EncodedRequestData));
|
OnRecordReadyToSend?.Invoke(this, new ListBytePortDataEventArgs(_recordInProcess.EncodedRequestData));
|
||||||
|
|
||||||
//time reminder of request record
|
//time reminder of request record
|
||||||
var requestTimeUtc = DateTimeOffset.UtcNow;
|
var requestTimeUtc = DateTimeOffset.UtcNow;
|
||||||
Int32 actualResponseWaitTimeMs;
|
Int32 actualResponseWaitTimeMs;
|
||||||
@@ -319,7 +320,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
|
|
||||||
//encode request protocol data with transmit protocol
|
//encode request protocol data with transmit protocol
|
||||||
var transmit = GetTransmitProtocol();
|
var transmit = GetTransmitProtocol();
|
||||||
var dataEncodedWithTransmitProtocol = transmit.DecodeDataForPhysicalLayer(cmd, payload, hideDataInLog);
|
var dataEncodedWithTransmitProtocol = transmit.DecodeDataForPhysicalLayer(_ident, cmd, payload, hideDataInLog);
|
||||||
|
|
||||||
//remind port specific response timeout
|
//remind port specific response timeout
|
||||||
var transmitPortSettings = transmit.GetTransmitPortSettings();
|
var transmitPortSettings = transmit.GetTransmitPortSettings();
|
||||||
@@ -339,13 +340,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
/// <remarks date="2022-Aug-24" author="R.Drabesch">
|
||||||
/// - Initial
|
/// - Initial
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
/// <param name="ident">string for logging of slot</param>
|
||||||
/// <param name="payload">Data package with all details like CRC, etc</param>
|
/// <param name="payload">Data package with all details like CRC, etc</param>
|
||||||
/// <param name="register"><see cref="RegisterDefinition" /> which is intend</param>
|
/// <param name="register"><see cref="RegisterDefinition" /> which is intend</param>
|
||||||
/// <param name="hideDataInLog">hiding data in log file to avoid spying of passwords</param>
|
/// <param name="hideDataInLog">hiding data in log file to avoid spying of passwords</param>
|
||||||
/// <param name="skipRetryErrorCode">error mask to skip retries</param>
|
/// <param name="skipRetryErrorCode">error mask to skip retries</param>
|
||||||
/// <returns>the assembled record for the send FIFO</returns>
|
/// <returns>the assembled record for the send FIFO</returns>
|
||||||
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
// ReSharper disable once InconsistentNaming UI1236 is a naming forced by the caller
|
||||||
public RequestRecord AddRecordToSendFifoUI1236(Byte[] payload, RegisterDefinition register = null,
|
public RequestRecord AddRecordToSendFifoUI1236(String ident, Byte[] payload, RegisterDefinition register = null,
|
||||||
Boolean hideDataInLog = false, UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode)
|
Boolean hideDataInLog = false, UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode)
|
||||||
{
|
{
|
||||||
const Byte maxValue = byte.MaxValue;
|
const Byte maxValue = byte.MaxValue;
|
||||||
@@ -355,9 +357,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
};
|
};
|
||||||
requestProtocolData.AddRange(payload);
|
requestProtocolData.AddRange(payload);
|
||||||
var transmitProtocol = GetTransmitProtocol();
|
var transmitProtocol = GetTransmitProtocol();
|
||||||
var encodedRequestData = transmitProtocol.DecodeDataForPhysicalLayerUI1236(payload);
|
var encodedRequestData = transmitProtocol.DecodeDataForPhysicalLayerUI1236(ident, payload, hideDataInLog);
|
||||||
var transmitPortSettings = transmitProtocol.GetTransmitPortSettings();
|
var transmitPortSettings = transmitProtocol.GetTransmitPortSettings();
|
||||||
var sendFifoUi1236 = new RequestRecord(maxValue, requestProtocolData, encodedRequestData,
|
var sendFifoUi1236 = new RequestRecord(maxValue, requestProtocolData, encodedRequestData,
|
||||||
transmitPortSettings.ResponseTimeoutMs, register, hideDataInLog, skipRetryErrorCode);
|
transmitPortSettings.ResponseTimeoutMs, register, hideDataInLog, skipRetryErrorCode);
|
||||||
_recordsSendFifo.Enqueue(sendFifoUi1236);
|
_recordsSendFifo.Enqueue(sendFifoUi1236);
|
||||||
return sendFifoUi1236;
|
return sendFifoUi1236;
|
||||||
@@ -407,13 +409,18 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
/// - Wakeup message retries from 5 to 2,
|
/// - Wakeup message retries from 5 to 2,
|
||||||
/// - Removed error base from error code decision as error base is only the AppId
|
/// - Removed error base from error code decision as error base is only the AppId
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
/// <remarks date="2023-Sep-01" author="T.Wiedebusch">
|
||||||
|
/// - HideDataInLog.
|
||||||
|
/// </remarks>
|
||||||
protected override void DecodeRecord(IPortDataEventArgs data)
|
protected override void DecodeRecord(IPortDataEventArgs data)
|
||||||
{
|
{
|
||||||
if (_recordInProcess == null) return;
|
if (_recordInProcess == null)
|
||||||
|
return;
|
||||||
//new request has to be analyzed
|
//new request has to be analyzed
|
||||||
_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded;
|
_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded;
|
||||||
//the request response record covers the entire request protocol
|
//the request response record covers the entire request protocol
|
||||||
var responseRecord = GetTransmitProtocol().DecodeDataForLogicLayer((List<Byte>)data.GetData());
|
var responseRecord = GetTransmitProtocol().DecodeDataForLogicLayer(_ident, (List<Byte>)data.GetData(),
|
||||||
|
_recordInProcess.HideDataInLog);
|
||||||
|
|
||||||
//on protocol decoding failure
|
//on protocol decoding failure
|
||||||
if (responseRecord.Count == 0)
|
if (responseRecord.Count == 0)
|
||||||
@@ -442,7 +449,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
{
|
{
|
||||||
_recordInProcess.Acknowledge = RequestAcknowledgeState.WakeupMessage;
|
_recordInProcess.Acknowledge = RequestAcknowledgeState.WakeupMessage;
|
||||||
//initiate a single retry on wakeup message response
|
//initiate a single retry on wakeup message response
|
||||||
if ( _recordInProcess.WakeupMessageRetryCtr < 2)
|
if (_recordInProcess.WakeupMessageRetryCtr < 2)
|
||||||
{
|
{
|
||||||
_recordInProcess.WakeupMessageRetryCtr++;
|
_recordInProcess.WakeupMessageRetryCtr++;
|
||||||
_logger.Debug($"{_ident} Wakeup message({_recordInProcess.WakeupMessageRetryCtr}) received");
|
_logger.Debug($"{_ident} Wakeup message({_recordInProcess.WakeupMessageRetryCtr}) received");
|
||||||
@@ -465,7 +472,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
|
|
||||||
//log request protocol content
|
//log request protocol content
|
||||||
_logger.Debug(_recordInProcess.HideDataInLog
|
_logger.Debug(_recordInProcess.HideDataInLog
|
||||||
? $"{_ident} DecodedRecord(*********************************)"
|
? $"{_ident} DecodedRecord(*****)"
|
||||||
: $"{_ident} DecodedRecord({BitConverter.ToString(responseRecord.ToArray())})");
|
: $"{_ident} DecodedRecord({BitConverter.ToString(responseRecord.ToArray())})");
|
||||||
|
|
||||||
//extract information command
|
//extract information command
|
||||||
@@ -605,17 +612,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
if (cRecord.ResponsePayload.Contains(0))
|
if (cRecord.ResponsePayload.Contains(0))
|
||||||
{
|
{
|
||||||
cRecord.ResponsePayload = completeResponse;
|
cRecord.ResponsePayload = completeResponse;
|
||||||
OnMeterRegisterUpdated?.Invoke(this, new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
|
OnMeterRegisterUpdated?.Invoke(this,
|
||||||
|
new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
|
||||||
if (expectedLength.HasValue && completeResponse.Count < expectedLength.Value)
|
if (expectedLength.HasValue && completeResponse.Count < expectedLength.Value)
|
||||||
{
|
{
|
||||||
_logger.Debug("Too Short. Payload contains zero");
|
_logger.Debug("Too Short. Payload contains zero");
|
||||||
}
|
}
|
||||||
|
|
||||||
return cRecord;
|
return cRecord;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (expectedLength.HasValue && completeResponse.Any() && completeResponse.Count < expectedLength.Value)
|
if (expectedLength.HasValue && completeResponse.Any() &&
|
||||||
|
completeResponse.Count < expectedLength.Value)
|
||||||
{
|
{
|
||||||
if (rest != RequestAcknowledgeState.Ok)
|
if (rest != RequestAcknowledgeState.Ok)
|
||||||
{
|
{
|
||||||
@@ -635,6 +645,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cRecord;
|
return cRecord;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,7 +764,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Boolean ContainsRegisterIdent(String registerName)
|
public Boolean ContainsRegisterIdent(String registerName)
|
||||||
{
|
{
|
||||||
return _recordsSendFifo.Any(a => string.Equals(a.Register.GetIdent(),
|
return _recordsSendFifo.Any(a => string.Equals(a.Register.GetIdent(),
|
||||||
registerName, StringComparison.CurrentCultureIgnoreCase));
|
registerName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
private MeterBatch _meterBatch = new MeterBatch();
|
private MeterBatch _meterBatch = new MeterBatch();
|
||||||
private readonly ILogger logger = NLogHelper.CreateOrGetLogger("GenesisFwLogger");
|
private readonly ILogger logger = NLogHelper.CreateOrGetLogger("GenesisFwLogger");
|
||||||
|
|
||||||
public Boolean IsBusy { get; private set; }
|
public Boolean IsBusy
|
||||||
|
{
|
||||||
|
get; private set;
|
||||||
|
}
|
||||||
|
|
||||||
public FrmRegisterStore()
|
public FrmRegisterStore()
|
||||||
{
|
{
|
||||||
@@ -270,14 +273,20 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
Console.WriteLine(value);
|
Console.WriteLine(value);
|
||||||
|
|
||||||
|
|
||||||
Task.Factory.StartNew(() => { read(); }).ContinueWith(delegate { SetBusy(false); });
|
Task.Factory.StartNew(() => { read(); }).ContinueWith(delegate
|
||||||
|
{
|
||||||
|
SetBusy(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnStore_Click(Object sender, EventArgs e)
|
private void btnStore_Click(Object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetBusy(true, "Store to file");
|
SetBusy(true, "Store to file");
|
||||||
Task.Factory.StartNew(() => { store(); }).ContinueWith(delegate { SetBusy(false); });
|
Task.Factory.StartNew(() => { store(); }).ContinueWith(delegate
|
||||||
|
{
|
||||||
|
SetBusy(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnFileToMeter_Click(Object sender, EventArgs e)
|
private void btnFileToMeter_Click(Object sender, EventArgs e)
|
||||||
@@ -293,7 +302,10 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
|
|
||||||
var filename = openFileDialog.FileName;
|
var filename = openFileDialog.FileName;
|
||||||
|
|
||||||
Task.Factory.StartNew(() => { load(filename); }).ContinueWith(delegate { SetBusy(false); });
|
Task.Factory.StartNew(() => { load(filename); }).ContinueWith(delegate
|
||||||
|
{
|
||||||
|
SetBusy(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +316,10 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
{
|
{
|
||||||
SetBusy(true, "writing register to meter");
|
SetBusy(true, "writing register to meter");
|
||||||
|
|
||||||
Task.Factory.StartNew(() => { WriteRegister(e); }).ContinueWith(delegate { SetBusy(false); });
|
Task.Factory.StartNew(() => { WriteRegister(e); }).ContinueWith(delegate
|
||||||
|
{
|
||||||
|
SetBusy(false);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,11 +344,14 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
array[i] = Convert.ToByte(arr[i], 16);
|
array[i] = Convert.ToByte(arr[i], 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
array = array.Reverse().ToArray();
|
|
||||||
// currentGenesis.WriteRegister(Register.Genesisflow.LedMode, (Byte)Ledmode.FlowTestAndCalibData, checkRegister: true);
|
// currentGenesis.WriteRegister(Register.Genesisflow.LedMode, (Byte)Ledmode.FlowTestAndCalibData, checkRegister: true);
|
||||||
var regdef =
|
var reg = (String)registerGridView.Rows[e.RowIndex].Cells[0].Value;
|
||||||
(String)registerGridView.Rows[e.RowIndex].Cells[0].Value;
|
var meterRegisters = _currentGenesis.GetConfigRegistersDefinitions();
|
||||||
_currentGenesis.WriteRegister(regdef, array, checkRegister: true);
|
var regDef = meterRegisters.GetRegisterDefinitionByName(reg);
|
||||||
|
|
||||||
|
if (regDef.DataType != typeof(String))
|
||||||
|
array = array.Reverse().ToArray();
|
||||||
|
_currentGenesis.WriteRegister(reg, array, checkRegister: true);
|
||||||
//_currentGenesis.Logout();
|
//_currentGenesis.Logout();
|
||||||
|
|
||||||
//var funkadresse = new List<byte>();
|
//var funkadresse = new List<byte>();
|
||||||
@@ -432,7 +450,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
{
|
{
|
||||||
Logger.Value.Error(ex, $"Slot #{slotNR} failed: {ex.Message}");
|
Logger.Value.Error(ex, $"Slot #{slotNR} failed: {ex.Message}");
|
||||||
}
|
}
|
||||||
_currentGenesis.Login("B507CC0978D6");
|
_currentGenesis.Login();
|
||||||
_currentPcbId = _currentGenesis.PcbId;
|
_currentPcbId = _currentGenesis.PcbId;
|
||||||
|
|
||||||
|
|
||||||
@@ -633,7 +651,9 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
private void read()
|
private void read()
|
||||||
{
|
{
|
||||||
regsToStore = new regStore()
|
regsToStore = new regStore()
|
||||||
{ PcbId = _currentPcbId, created = DateTimeOffset.Now, keyValues = new List<regDefValue>() };
|
{
|
||||||
|
PcbId = _currentPcbId, created = DateTimeOffset.Now, keyValues = new List<regDefValue>()
|
||||||
|
};
|
||||||
var total = 0;
|
var total = 0;
|
||||||
foreach (var rowItem in _dataTable.Rows)
|
foreach (var rowItem in _dataTable.Rows)
|
||||||
{
|
{
|
||||||
@@ -678,12 +698,15 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tmpList = rawRegister.ToList();
|
var tmpList = rawRegister.ToList();
|
||||||
tmpList.Reverse();
|
if (regDef.DataType != typeof(String))
|
||||||
|
tmpList.Reverse();
|
||||||
if (rawRegister != null)
|
if (rawRegister != null)
|
||||||
{
|
{
|
||||||
((DataRow)rowItem)["RawValue"] = BitConverter.ToString(tmpList.ToArray());
|
((DataRow)rowItem)["RawValue"] = BitConverter.ToString(tmpList.ToArray());
|
||||||
regsToStore.keyValues.Add(new regDefValue()
|
regsToStore.keyValues.Add(new regDefValue()
|
||||||
{ def = regDef, value = BitConverter.ToString(rawRegister) });
|
{
|
||||||
|
def = regDef, value = BitConverter.ToString(rawRegister)
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +793,8 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tmpList = rawRegister.ToList();
|
var tmpList = rawRegister.ToList();
|
||||||
tmpList.Reverse();
|
if (regDef.DataType != typeof(String))
|
||||||
|
tmpList.Reverse();
|
||||||
|
|
||||||
if (rawRegister != null)
|
if (rawRegister != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Xylem.Common.Ui.IrdaFunctionalTestApp
|
|||||||
|
|
||||||
Byte command = 0x09;
|
Byte command = 0x09;
|
||||||
Byte []payload = {0x0D, 0x0F, 0x00, 0x00, 0x00, 0x00 };
|
Byte []payload = {0x0D, 0x0F, 0x00, 0x00, 0x00, 0x00 };
|
||||||
var txBuffer = transmit.DecodeDataForPhysicalLayer(command, payload);
|
var txBuffer = transmit.DecodeDataForPhysicalLayer(Ident, command, payload);
|
||||||
|
|
||||||
_irdaComPort.Open();
|
_irdaComPort.Open();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user