public void SetCommand(PatternCommand command) { if (Command != PatternCommand.None) { throw new Exception("A command has already been set!"); } Command = command; }
/// <summary> /// Requests the device to carry out a specific pattern. /// </summary> /// <param name="patternType">Specify the pattern the device should carry out</param> /// <param name="repeatCount">Number of time the pattern should be repeated</param> /// <param name="timeout">Time, in milliseconds, after which the application should stop waiting for the acknowledgment of this message</param> /// <returns>Task representing the operation. Result is true if the message has been acknowledged, false otherwise</returns> public Task <bool> CarryOutPattern(PatternType patternType, byte repeatCount, int timeout = 0) { var command = new PatternCommand(patternType, repeatCount); return(SendCommand(command, timeout)); }
public CommandElement(PatternCommand value) { Value = value; }