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:
- A scanner is downloaded from the store;
- A user enters scanner parameters (IP, Port , etc) these parameters go to the scanner script;
- After processing the entered parameters the scanner asks the bus about devices or looks for devices in the local net;
- A list of formed from the found devices;
- 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:
- Creating a driver
- Equipment search
- If equipment is found, it is necessary to identify what equipment it is
- 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.
