public NodeInfo(byte[] data) { if (data == null) throw new ArgumentNullException("data"); if (data.Length < 28) throw new ArgumentException("data length not sufficient to fill NodeInfo"); var stack = new SimpleStack(data); Name = stack.PopName(); Description = stack.PopString(); Location = stack.PopString(); Address = stack.PopAddress(); Type = stack.PopString(); Hardware = stack.PopName(); Version = stack.PopName(); DigitalInputs = stack.PopByte(); DigitalOutputs = stack.PopByte(); AnalogInputs = stack.PopByte(); CounterInputs = stack.PopByte(); PwmOutputs = stack.PopByte(); WiresCount = stack.PopByte(); DevicesCount = stack.PopByte(); SensorsCount = stack.PopByte(); ResetPin = stack.PopByte(); }