laatzen/Common/Hardware/Common.Hardware.SIRT/Tasks/IdentifySIRTTask.cs
2025-04-29 11:24:33 +02:00

31 lines
790 B
C#

namespace Common.Hardware.SIRT.Tasks
{
using System;
public class IdentifySIRTTask : ReadRegisterTask
{
public IdentifySIRTTask()
{
this.RequestAddress = 0x11001820;
this.ResponseAddress = 0x11001820;
this.Length = 0x08;
}
public override void Push(SIRTMessage response)
{
if (response.Command == SIRTConstants.AKN_ANS)
{
this.Payload = response.Payload;
if (this.Payload?.Length == 8)
{
this.SirtId = BitConverter.ToString(this.Payload);
this.Frequency = this.SirtId[10] == '0' ? 868 : 433;
this.SetCompleted();
}
}
}
}
}