exports.Initialization = function(){
  var obj = new Object();
  var Class = new Dbus();

  obj["GetDbusInterface"] = function(Bus, BusObject){return Class.GetDbusInterface(Bus, BusObject)};
  obj["DBusReadVariantArray"] = function(VariableArray, BusInterface, socket_or_res, isCGI){return Class.DBusReadVariantArray(VariableArray, BusInterface, socket_or_res, isCGI)};
  obj["DBusWriteVariantArray"] = function(VariableArray, BusInterface, socket_or_res, isCGI){return Class.DBusWriteVariantArray(VariableArray, BusInterface, socket_or_res, isCGI)};
  return obj;
};

//.h.js
function Dbus()
{
	this.GetDbusInterface = function(Bus, BusObject){return Dbus.prototype._GetDbusInterface_(Bus, BusObject);};
	this.DBusReadVariantArray = function(VariableArray, BusInterface, socket_or_res, isCGI){return Dbus.prototype._DBusReadVariantArray_(VariableArray, BusInterface, socket_or_res, isCGI);};
	this.DBusWriteVariantArray = function(VariableArray, BusInterface, socket_or_res, isCGI){return Dbus.prototype._DBusWriteVariantArray_(VariableArray, BusInterface, socket_or_res, isCGI);};
}





//.jpp.js
Dbus.prototype._GetDbusInterface_ = function(Bus, BusObject)
{
	var SetInterval = setInterval(function()
	{
		Bus.getInterface('UA_runtime.RW.Variable',
						 '/UA_runtime/RW/Variable',
						 'UA_runtime.RW.Variable',function(err, iface)
						{
							if(!err)
							{
								BusObject["BusInterface"]=iface;
								clearInterval(SetInterval);
							}
						});
	}, 1000);
};

Dbus.prototype._DBusReadVariantArray_ = function(VariableArray, BusInterface, socket_or_res, isCGI)
{
	if(typeof(BusInterface) == "undefined")	{return 0;}
	var Timeout={timeout:1000};
	BusInterface.ReadVariantArray(VariableArray, Timeout, function(err,values)
	{
		if(isCGI == true)
		{
			socket_or_res.send(values);
		}
		else
		{
			socket_or_res.emit('DBusReadVariantArray', values);
		}
	});
};

Dbus.prototype._DBusWriteVariantArray_ = function(VariableArray, BusInterface, socket_or_res, isCGI)
{
	if(typeof(BusInterface) == "undefined")	{return 0;}
	var Timeout={timeout:1000};
	var Name=VariableArray[0];
	var Value=VariableArray[1];
	BusInterface.WriteVariantArray([Name], [Value], Timeout, function (err, values)
	{
		if(isCGI == true)
		{
			socket_or_res.send(true);
		}
		else
		{
			socket_or_res.emit('DBusWriteVariantArray', true);
		}
	});
};