code: function AzureIoTHubNode(config) {
          // Store node for further use
          var node = this;
          //nodeConfig = config;
  
          // Create the Node-RED node
          RED.nodes.createNode(this, config);
          node.on('input', function (msg) {
  
              var messageJSON = null;
  
              if (typeof (msg.payload) != "string") {
                  node.log("JSON");
                  messageJSON = msg.payload;
              } else {
                  node.log("String");
                  //Converting string to JSON Object
                  //Sample string: {"deviceId": "name", "key": "jsadhjahdue7230-=13", "protocol": "amqp", "data": "25"}
                  messageJSON = JSON.parse(msg.payload);
              }
  
              //Creating connectionString
              //Sample
              //HostName=sample.azure-devices.net;DeviceId=sampleDevice;SharedAccessKey=wddU//P8fdfbSBDbIdghZAoSSS5gPhIZREhy3Zcv0JU=
              newConnectionString = "HostName=" + node.credentials.hostname + ";DeviceId=" + messageJSON.deviceId + ";SharedAccessKey=" + messageJSON.key
  	    if( typeof messageJSON.protocol !== 'undefined'){
              	newProtocol = messageJSON.protocol;
  	    } else {
  		newProtocol = config.protocol;
  	    }
  
              // Sending data to Azure IoT Hub Hub using specific connectionString
              sendMessageToIoTHub(node, messageJSON.data, nodeConfigUpdated(newConnectionString, newProtocol));
          });
  
          node.on('close', function () {
              disconnectFromIoTHub(node, this);
          });
  
      }
docs: Main function called by Node-RED