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

81 lines
1.9 KiB
C#

namespace Common.Hardware.SIRT.Tasks
{
using Common.Hardware.SIRT.Parameters;
using System;
public class WritePamTask : SIRTTask
{
protected P811 p811;
public WritePamTask()
{
this.request.Command = SIRTConstants.W_PAM;
this.p811 = this.request.P1;
}
public bool WakeUpModul
{
get => this.p811.WakeUpModul;
set => this.SetP811(x => x.WakeUpModul = value);
}
public bool WakeUpCmd
{
get => this.p811.WakeUpCmd;
set => this.SetP811(x => x.WakeUpCmd = value);
}
public bool IgnoreTimeout
{
get => this.p811.IgnoreTimeout;
set => this.SetP811(x => x.IgnoreTimeout = value);
}
public bool DelPamSemi
{
get => this.p811.DelPamSemi;
set => this.SetP811(x => x.DelPamSemi = value);
}
public bool DelPamTx
{
get => this.p811.DelPamTx;
set => this.SetP811(x => x.DelPamTx = value);
}
public bool DelPamAdr
{
get => this.p811.DelPamAdr;
set => this.SetP811(x => x.DelPamAdr = value);
}
public bool DelPamAll
{
get => this.p811.DelPamAll;
set => this.SetP811(x => x.DelPamAll = value);
}
public byte[] Data
{
get => this.request.Payload;
set => this.request.Payload = value;
}
private void SetP811(Action<P811> p811Setter)
{
p811Setter.Invoke(this.p811);
this.request.P1 = this.p811;
}
public override void Push(SIRTMessage response)
{
if (response.Length > 0 && response.Payload[0] == SIRTConstants.SEMI)
{
this.SetCompleted();
}
}
}
}