Example #1
0
        private bool SendCommand(GenericCommandName genericCommandName)
        {
            if (!_genericCommandNameToCommandCode.ContainsKey(genericCommandName))
            {
                throw new ArgumentException("Unknown command name.", nameof(genericCommandName));
            }

            return(_serialBlaster.SendCommand(SerialBlaster.Protocol.Nec, _genericCommandNameToCommandCode[genericCommandName].CodeWithChecksum));
        }
Example #2
0
        public bool LoadProfile(ProfileName profileName)
        {
            bool result = true;

            //Access load profile menu
            result &= SendCommand(GenericCommandName.Number10);

            //Loading profiles 10-14 require an additional send of the load profile command
            if ((int)profileName >= 10)
            {
                result &= SendCommand(GenericCommandName.Number10);
            }

            GenericCommandName numberCommand = ConvertProfieNameToGenericCommandName(profileName);

            result &= SendCommand(numberCommand);

            return(result);
        }
Example #3
0
 public static bool Valid(this GenericCommandName genericCommandName)
 {
     return(Enum.IsDefined(typeof(GenericCommandName), genericCommandName));
 }