Native Lib

本地库,如身份证读卡器设备的使用需要调用本地的dll库。

安装

npm install @cutos/drivers

引入依赖

const {NativeLib} = require("./simulator/native-lib");

NativeLib

constructor(lib_path, simulator)
  • lib_path:共享库名称
  • simulator:设备模拟器
举例:
this.simulator = new DeviceIDCardReaderSimulator()
this.lib = new NativeLib('ghcmio.dll', this.simulator);

NativeLib.func

查找函数

NativeLib.func(signature);
举例:
this.lib.func('size_t __stdcall mio_open(char* psport, char* psexport, int32_t baud)')

results matching ""

    No results matching ""