38 lines
945 B
C#
38 lines
945 B
C#
namespace Common.Hardware.SIRT.Tasks
|
|
{
|
|
using System;
|
|
|
|
public class ReadPampoolTask : ReadPamTask
|
|
{
|
|
public ReadPampoolTask(int frequency)
|
|
{
|
|
this.Frequency = frequency;
|
|
this.RequestAddress = 0xFFFFFFFF;
|
|
this.Addresses = new uint[5];
|
|
this.Timeout = 3_000;
|
|
}
|
|
|
|
public uint[] Addresses { get; }
|
|
|
|
public override void Receive(SIRTMessage response)
|
|
{
|
|
base.Receive(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]++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|