public static IEnumerable <byte> GetParcel_SetAddress(int addr, bool forCommonAddr, bool answerEn = true) { return(GetParcel((byte)OwnAddress, forCommonAddr ? BroadcastAddr : DefaultAddr, (byte)RepeatQuantity, answerEn, TbCommands.SetAddress((byte)addr))); }
public static IEnumerable <byte> GetParcel_SetClock(DateTime dt, bool answerEn = true) { return(GetParcel((byte)OwnAddress, BroadcastAddr, (byte)RepeatQuantity, answerEn, TbCommands.SetClock(dt))); }
public static IEnumerable <byte> GetParcel_SetClock(int dayOfWeek, int hours, int minutes, bool answerEn = true) { return(GetParcel((byte)OwnAddress, BroadcastAddr, (byte)RepeatQuantity, answerEn, TbCommands.SetClock(dayOfWeek, hours, minutes))); }
public static IEnumerable <byte> GetParcel_GetAddress() { return(GetParcel((byte)OwnAddress, BroadcastAddr, (byte)RepeatQuantity, true, TbCommands.GetAddress())); }
public static IEnumerable <byte> GetParcel_GetSensors(int addr) { return(GetParcel((byte)OwnAddress, (byte)addr, (byte)RepeatQuantity, true, TbCommands.GetSensors())); }
public static IEnumerable <byte> GetParcel_ChangeOut(int addr, int number, int value, bool answerEn = true) { return(GetParcel((byte)OwnAddress, (byte)addr, (byte)RepeatQuantity, answerEn, TbCommands.ChangeOutput((byte)number, (byte)value))); }
public static IEnumerable <byte> GetParcel_ChangeRepeater(int addr, bool isSetRepeater, bool answerEn = true) { return(GetParcel((byte)OwnAddress, (byte)addr, (byte)RepeatQuantity, answerEn, TbCommands.ChangeRepeater((byte)(isSetRepeater ? 1 : 0)))); }
public static void TestCrc(Action <byte, IEnumerable <byte> > afterGetCrc) { for (byte fromAddr = 1; fromAddr < 5; ++fromAddr) { for (byte toAddr = 1; toAddr < 50; ++toAddr) { for (byte repeatCount = 0; repeatCount < 10; ++repeatCount) { for (byte answerEn = 0; answerEn < 2; ++answerEn) { for (byte setAddr = 0; setAddr < 100; ++setAddr) { Test_GetCrc(afterGetCrc, fromAddr, toAddr, repeatCount, answerEn, TbCommands.SetAddress(setAddr)); } for (byte setOut = 1; setOut < 30; ++setOut) { for (byte outputValue = 0; outputValue < 100; ++outputValue) { Test_GetCrc(afterGetCrc, fromAddr, toAddr, repeatCount, answerEn, TbCommands.ChangeOutput(setOut, outputValue)); } } for (byte setD = 1; setD < 8; ++setD) { for (byte setHour = 0; setHour < 24; ++setHour) { for (byte setMin = 0; setMin < 60; ++setMin) { Test_GetCrc(afterGetCrc, fromAddr, toAddr, repeatCount, answerEn, TbCommands.SetClock(setD, setHour, setMin)); } } } } } } } }