Материал из Module developer
Перейти к: навигация, поиск

IR.ModuleSetupFinish

{{API Function/ru |description=Completing module installation. It is required when a scanner is developed. When a scanner is developed, this method has to be used to set module installation with required data. |constructor= IR.ModuleSetupFinish(StoreID, ModuleData, [Callback]) |input=

StoreID 82 type: Number
Module ID in the store
ModuleData type: Object
Module data that are required for its work. See below the format of writing data for the module
Callback function(in_error){...} type: Function
Funtion that is performed after a module is installed.
  • in_error - incoming parameter signalling about successful installation
    • 0 - no errors
    • 1 - installation errors

|output= - |JSsample=

//Example of installing HDL Dimmer using a scanner
var l_nStoreID = 82;
var l_oModuleData = {
	Module: {
		//Data required for module work
		Type: "Dimmer", 
		SubnetID: 3,
		DeviceID: 6 
		Name: "HDL Dimmer"
	}
	Drivers: {
		//Data for driver
		"HDL-BUS Pro Network (UDP)": {
		   Host: "255.255.255.255", //setting a host for a driver
		   Port: "6000" //setting a port for a deriver
		},
	}
}