code: func NewMessage(data []byte) (*Message, error) {
  	message := &Message{}
  	message.startByte = data[0]
  	if len(data) <= 1 {
  		return message, nil
  	}
  	message.Length = data[1]
  	message.MessageType = data[2]
  	message.Function = ZWaveFunction(data[3])
  
  	var err error
  	switch message.Function {
  	case ApplicationCommandHandler:
  		message.NodeID = data[5]
  
  		message.Data, err = NewApplicationCommandHandler(data[7 : 7+data[6]])
  	case DiscoveryNodes:
  
  		message.Data, err = NewDiscoverdNodes(data[7 : 7+data[6]])
  	case GetNodeProtocolInfo:
  
  		message.Data, err = NewGetNodeProtocolInfo(data[4:])
  	default:
  		err = fmt.Errorf("Dropping message function='%s' with data %x (not implemented)", message.Function, data[4:])
  	}
  
  	if err != nil {
  		return nil, err
  	}
  
  	logrus.Debugf("Message: %+v Message data: %+v", message, message.Data)
  	return message, err
  
  	// 1 FrameHeader (type of message)
  	// 1 Message length
  	// 1 Request (00) or Response (01)
  	// 1 Function
  	//
  	// 1 (Node ID)
  	// 1 (Command - length)
  	// - (Command)
  	// - (Transmit options)
  	// - (Callback id)
  	// 1 Checksum
  
  	// Type
  	//Request = 0x00,
  	//Response = 0x01,
  	//GetVersion = 0x15,
  	//MemoryGetId = 0x20,
  	//ClockSet = 0x30
  
  	// Transmit options
  	//Ack = 0x01,
  	//LowPower = 0x02,
  	//AutoRoute = 0x04,
  	//ForceRoute = 0x08
  
  }
docs: // NewMessage tries to decode a binary message from the controller in to a message struct