private IFirmataMessage HeaderGetMessage(MessageHeader messageHeader) { var value7Bit = messageHeader.MessageBuffer.Skip(3).Take(messageHeader.MessageBufferIndex - 3).Select(f => (byte)f).ToArray(); var value = ByteArrayExtensions.Decode7Bit(value7Bit); var currentState = new GenericResponse <byte[]> { MessageType = (byte)messageHeader.MessageBuffer[1], MessageSubType = (byte)messageHeader.MessageBuffer[2], Value = value }; return(new FirmataMessage <GenericResponse <byte[]> >(currentState)); }