Files
laatzen/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Features/SetDateAndTime.cs
T

30 lines
725 B
C#

namespace Common.Hardware.WaterMeter.eRegister.Features
{
using Common.Hardware.SIRT;
using Common.Hardware.WaterMeter.eRegister.Telegrams;
using System;
public class SetDateAndTime : Pam
{
public SetDateAndTime() : base(5, SetDateAndTime)
{
}
public uint SecondsSince20000101
{
get => this.bytes.ToUInt32BE(1);
set => value.GetBytesBE().CopyTo(this.bytes, 1);
}
public static implicit operator SetDateAndTime(double offset) => new SetDateAndTime
{
SecondsSince20000101 = new Epoch20000101
{
DateTime = DateTime.UtcNow.AddHours(offset)
}
};
}
}