Example #1
0
        protected internal override void HandleEvent(Command command)
        {
            base.HandleEvent(command);

            if (command.Payload.Length < 4)
            {
                throw new ReponseFormatException($"The response was not in the expected format. {GetType().Name}: Payload: {BitConverter.ToString(command.Payload)}");
            }

            byte         endPointId   = command.Payload[0];
            CommandClass commandClass = (CommandClass)command.Payload[2];

            lock (_endpointCommandClasses)
            {
                if (_endpointCommandClasses.ContainsKey(endPointId))
                {
                    EndpointSupportedCommandClassBase endpointCommandClass = _endpointCommandClasses[endPointId].Values.FirstOrDefault(cc => cc.Class == commandClass);
                    if (endpointCommandClass != null)
                    {
                        endpointCommandClass.HandleEndpointReport(command.Payload.Skip(4).ToArray(), command.Payload[3]);
                    }
                }
            }

            // This part is for backward compatibility.
            //
            var report = new MultiChannelReport(Node, command.Payload);

            OnChanged(new ReportEventArgs <MultiChannelReport>(report));
        }
Example #2
0
        protected internal override void HandleEvent(Command command)
        {
            base.HandleEvent(command);

            var report = new MultiChannelReport(Node, command.Payload);
            OnChanged(new ReportEventArgs<MultiChannelReport>(report));
        }
Example #3
0
        protected internal override void HandleEvent(Command command)
        {
            base.HandleEvent(command);

            var report = new MultiChannelReport(Node, command.Payload);

            OnChanged(new ReportEventArgs <MultiChannelReport>(report));
        }