Beispiel #1
0
        public async Task <VersionCommandClassReport> GetCommandClass(CommandClass @class, CancellationToken cancellationToken)
        {
            var response = await Channel.Send(
                Node,
                new Command(Class, command.CommandClassGet, Convert.ToByte(@class)),
                command.CommandClassReport,
                VersionCommandClassReport.GetResponseValidatorForCommandClass(Node, @class),
                cancellationToken);

            return(new VersionCommandClassReport(Node, response));
        }
Beispiel #2
0
 internal static Func <byte[], bool> GetResponseValidatorForCommandClass(Node node, CommandClass @class)
 {
     return(payload =>
     {
         try
         {
             var report = new VersionCommandClassReport(node, payload);
             return report.Class == @class;
         }
         catch
         {
             return false;
         }
     });
 }