Device JS Secondary Development Guide

Equipment JS ES6 secondary development

# Add device class

Under the platform directory of kiosk-cli-2nd, there is an example of adding an interface for secondary development of the camera, inheriting the existing camera class, as shown in the following figure: 

 

img Create a new device js file under this path, such as adding a pinpad device js: pinpad-2nd.js
(1) Import platform device js
import { Device } from '@/platform/lib/platform.umd'
(2) Introduce the device class
const CPinPad = Device.classPool.CPinPad;
(3) Define a new device class and inherit the corresponding device
class in the platform CPinPad2nd extends CPinPad

  • Device call method
    If it is an asynchronous call, use this.execute("method name", param), where the method name needs to be the same as that provided by the middleware

Guess you like

Origin blog.csdn.net/weixin_41937552/article/details/131906115