コード例 #1
0
ファイル: PatternState.cs プロジェクト: Seti-0/NSprak
        public void SetCommand(PatternCommand command)
        {
            if (Command != PatternCommand.None)
            {
                throw new Exception("A command has already been set!");
            }

            Command = command;
        }
コード例 #2
0
        /// <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));
        }
コード例 #3
0
ファイル: CommandElement.cs プロジェクト: Seti-0/NSprak
 public CommandElement(PatternCommand value)
 {
     Value = value;
 }