123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- var JLSDK = require("./JLDeviceWechat+33Protocol"),
- code = require("./errorCode");
- export function ScanDevice(t, e) {
- JLSDK.scanDevice(t, 1e4, t => {
- e.call(this, t)
- })
- }
- export function StopScanDevice(t) {
- JLSDK.stopScanDevice(e => {
- t.call(this, e)
- })
- }
- export function ConnectDevice(t, e, c) {
- JLSDK.connectDevice(t, t => {
- c.call(this, t), 0 == t.code && JLSDK.onDisconnet(t => {
- e.call(this, t)
- })
- })
- }
- export function DisconnectDevice(t) {
- JLSDK.disConnectDevice(e => {
- t.call(this, e)
- })
- }
- export function OpenChannel(t) {
- JLSDK.ESAMRset(e => {
- t.call(this, e)
- })
- }
- export function GetSerialNo(t) {
- JLSDK.getObuSN(e => {
- t.call(this, e)
- })
- }
- export function checkCardExists(t) {
- JLSDK.checkCard(e => {
- t.call(this, e)
- })
- }
- export function OpenCard(t) {
- JLSDK.ICCReset(e => {
- t.call(this, e)
- })
- }
- export function GetCardNo(t) {
- JLSDK.getCardNum(e => {
- t.call(this, e)
- })
- }
- export function GetCardFile15(t) {
- JLSDK.getCardInfo(e => {
- t.call(this, e)
- })
- }
- export function GetCardFile16(t) {
- JLSDK.getCardholderInfo(e => {
- t.call(this, e)
- })
- }
- export function GetCardFileCustom(t, e, c) {
- JLSDK.readRetainFile(t, e, t => {
- c.call(this, t)
- })
- }
- export function SetCardFile0015(t, e) {
- JLSDK.getCardRandNum(0, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeCardInfomation(1, t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function SetCardFile0016(t, e) {
- JLSDK.getCardRandNum(1, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeCardInfomation(0, t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function SetCardFileCustomer(t, e) {
- JLSDK.getCardRandNum(0, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeRetainFile(t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function InitLoad(t, e, c, a, o, i) {
- JLSDK.creditForLoad_Init(t, "01", a, e, t => {
- console.log(JSON.stringify(t)), t.code === code.successCode() ? o.call(this, t.data.rand, t.data.trade_no, t.data.mac1, t.data.balance, t => {
- 0 == t.code ? JLSDK.creditForLoad_Load(c, t.data, t => {
- i.call(this, t)
- }) : i.call(this, t)
- }) : i.call(this, t)
- })
- }
- export function GetSystemInfo(t) {
- JLSDK.getSystemInfo(e => {
- t.call(this, e)
- })
- }
- export function GetVehicleInfo(t, e) {
- JLSDK.getCarInfo(t, t => {
- e.call(this, t)
- })
- }
- export function SetSystemInfo(t, e) {
- JLSDK.getObuRadom(0, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeObuIfo(1, t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function SetVehicleInfo(t, e) {
- JLSDK.getObuRadom(1, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeObuIfo(1, t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function Activate(t, e) {
- JLSDK.getObuRadom(0, c => {
- c.code == code.successCode() ? t.call(this, c.data, t => {
- 0 == t.code ? JLSDK.writeSystemInfo(t.data, t => {
- e.call(this, t)
- }) : e.call(this, t)
- }) : e.call(this, c)
- })
- }
- export function CpuCommand(t, e) {
- JLSDK.ICCChannel(t, t => {
- e.call(this, t)
- })
- }
- export function ObuCommand(t, e) {
- JLSDK.ESAMChannel(t, t => {
- e.call(this, t)
- })
- }
|