Beispiel #1
0
        void IPayloadSerializable.Read(PayloadReader reader)
        {
            NodeID = reader.ReadByte();
            var basicType    = (BasicType)reader.ReadByte();
            var genericType  = (GenericType)reader.ReadByte();
            var specificType = reader.ReadSpecificType(genericType);

            NodeType = new NodeType(basicType, genericType, specificType);

            SupportedCommandClasses = reader
                                      .ReadBytes(reader.Length - reader.Position)
                                      .TakeWhile(x => x != 0xEF)
                                      .Select(x => (CommandClass)x)
                                      .OrderBy(element => element.ToString())
                                      .ToArray();
        }
        void IPayloadSerializable.Read(PayloadReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            Capability = reader.ReadByte();
            Security   = (Security)reader.ReadByte();
            Reserved   = reader.ReadByte();

            var basicType    = (BasicType)reader.ReadByte();
            var genericType  = (GenericType)reader.ReadByte();
            var specificType = reader.ReadSpecificType(genericType);

            NodeType = new NodeType(basicType, genericType, specificType);
        }