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

Scanner is a module that analyzes a bus for connected devices or searches devices in the local net. The found devices are displayed in a list, a module for the selected device is downloaded and it becomes available in i3 lite.
The scheme of scanner work:

  1. A scanner is downloaded from the store;
  2. A user enters scanner parameters (IP, Port , etc) these parameters go to the scanner script;
  3. After processing the entered parameters the scanner asks the bus about devices or looks for devices in the local net;
  4. A list of formed from the found devices;
  5. When a definite device is selected in a list, the scanner sends the parameters of a selected device to the module.


Consider the following when developing a scanner:

  • Scanner parameters when it is added from the store;
  • Scanner logics;
  • Sending parameters of a selected device to a module;
  • Module logics, considering parameters sent by the scanner.


Developing a scanner is similar to developing a module. A vizual part must be designed, a driver must be created and a script with logics must be written. The main difference is that a scanner can work only on a control panel and a scanner will never be launched on a server. That's why, when developing scripts there is no need divide scripts into driver scripts and interface scripts.
When developing a scanner new logics of work appears. First of all make a module to control a device. Then upload the module into the store of modules. When a module is uploaded, you see the unique ID of your module. When you develop a scanner, write a script with the following logics:

  1. Creating a driver
  2. Equipment search
  3. If equipment is found, it is necessary to identify what equipment it is
  4. with the help of ModuleSetupFinish command (module ID модуля, js object with setup settings of this module)

After it the app downloads a module from the module store and installs it.