common/Hardware/Common.Hardware.SIRT/Tasks/IdentifySIRTTask.cs
2026-04-23 17:50:07 +02:00

31 lines
795 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 Receive(SIRTMessage response)
{
if (response.Command == SIRTConstants.ACKN_ANSW)
{
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();
}
}
}
}
}