vf107/src/driver.js
@@ -13,7 +13,7 @@
import pwm from '../dxmodules/dxPwm.js'
import ntp from '../dxmodules/dxNtp.js'
import gpio from "../dxmodules/dxGpio.js"
import nfc from "../dxmodules/dxNfc.js"
import dxNfcCard from "../dxmodules/dxNfcCard.js"
import watchdog from "../dxmodules/dxWatchdog.js"
import dxGpioKey from "../dxmodules/dxGpioKey.js"
import net from "../dxmodules/dxNetwork.js"
@@ -48,7 +48,7 @@
            config.set('mqtt.clientId', uuid)
        }
        if (driver.device.finger) {
            if (dxDriver.DRIVER.MODEL == "vf105") {
            if (dxDriver.DRIVER.MODEL == "vf105" || dxDriver.DRIVER.MODEL == "vf107") {
                config.set('sys.model', "vf107")
            } else if (dxDriver.DRIVER.MODEL == "vf114") {
                config.set('sys.model', "vf124")
@@ -129,7 +129,7 @@
        if (dxDriver.DRIVER.MODEL == "vf203") {
            pwm.init(dxDriver.PWM.NIR_SUPPLEMENT_CHANNEL);
            pwm.setPower(nirLuminance, dxDriver.PWM.NIR_SUPPLEMENT_CHANNEL);
        } else if (dxDriver.DRIVER.MODEL == "vf202" || dxDriver.DRIVER.MODEL == "vf114" || dxDriver.DRIVER.MODEL == "vf105") {
        } else if (dxDriver.DRIVER.MODEL == "vf202" || dxDriver.DRIVER.MODEL == "vf114" || dxDriver.DRIVER.MODEL == "vf105" || dxDriver.DRIVER.MODEL == "vf107") {
            pwm.init(dxDriver.PWM.WHITE_SUPPLEMENT_CHANNEL);
            pwm.init(dxDriver.PWM.NIR_SUPPLEMENT_CHANNEL);
            pwm.setPower(whiteLuminance, dxDriver.PWM.WHITE_SUPPLEMENT_CHANNEL);
@@ -176,21 +176,16 @@
driver.nfc = {
    NFC_CARD_RECEIVE: "nfcCardReceive",
    EID_RECEIVE: "eidReceive",
    options: { m1: true, psam: false },
    init: function () {
        if (!config.get('sys.nfc')) {
            logger.debug("刷卡已关闭")
            return
        }
        this.options.useEid = config.get("sys.nfcIdentityCardEnable") == 3 ? 1 : 0
        nfc.worker.beforeLoop(this.options)
        dxNfcCard.init();
    },
    eidInit: function () {
        if (!config.get('sys.nfc')) {
            return
        }
        if (config.get("sys.nfcIdentityCardEnable") == 3) {
            nfc.eidUpdateConfig({ appid: "1621503", sn: config.get("sys.sn"), device_model: config.get("sys.appVersion") })
        try {
            dxNfcCard.eidInit({ config: {
                device_model: dxDriver.DRIVER.MODEL
            } })
        } catch (error) {
            logger.error(error)
        }
    },
    eidActive: function (code) {
@@ -199,21 +194,22 @@
            version: config.get("sys.appVersion"),
            macAddr: config.get("sys.mac")
        };
        return nfc.eidActive(options);
        return dxNfcCard.eidActive(options);
    },
    getConfig: function () {
        return nfc.getConfig();
        return dxNfcCard.getConfig();
    },
    setConfig: function (options) {
        nfc.updateConfig(options);
        dxNfcCard.updateConfig(options);
    },
    setCallbacks: function (callbacks) {
        dxNfcCard.setCallbacks(callbacks);
    },
    loop: function () {
        if (!config.get('sys.nfc')) {
            return
        }
        nfc.worker.loop(this.options)
        dxNfcCard.loop();
    },
}
driver.face = {
    options: {
@@ -366,7 +362,7 @@
driver.uartCode = {
    RECEIVE_MSG: '__UART_RECEIVE_MSG__',
    init: function () {
        if (dxDriver.DRIVER.MODEL == 'vf105') {
        if (dxDriver.DRIVER.MODEL == 'vf105' || dxDriver.DRIVER.MODEL == 'vf107') {
            dxVgCode.init('/dev/ttySLB1', '115200-8-N-1')
        } else if (dxDriver.DRIVER.MODEL == 'vf114') {
            dxVgCode.init('/dev/ttySLB3', '115200-8-N-1')