laatzen/Common/Hardware/Common.Hardware.SIRT/Tasks/ReadPampoolTask.cs

38 lines
939 B
C#
Raw Normal View History

2025-04-28 08:10:33 +00:00
namespace Common.Hardware.SIRT.Tasks
{
using System;
public class ReadPampoolTask : ReadPamTask
{
2025-04-30 10:27:07 +00:00
public ReadPampoolTask(int frequency)
2025-04-28 08:10:33 +00:00
{
2025-04-30 10:27:07 +00:00
this.Frequency = frequency;
2025-04-28 08:10:33 +00:00
this.RequestAddress = 0xFFFFFFFF;
this.Addresses = new uint[5];
this.Timeout = 3_000;
}
public uint[] Addresses { get; }
public override void Push(SIRTMessage response)
{
base.Push(response);
if (this.Payload?.Length == 20)
{
Array.Clear(this.Addresses, 0, 5);
for (var i = 0; i < 20; i++)
{
this.Addresses[i] = BitConverter.ToUInt32(this.Payload, i * 4);
if (this.Addresses[i] == 0xFFFFFFFF)
{
this.Addresses[i]++;
}
}
}
}
}
}