|
|
@ -35,7 +35,26 @@ Page({ |
|
|
|
|
|
|
|
this.openLock(userTelephone, userPassword, pwd, openLockType) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
btntest3(event){ |
|
|
|
var that = this |
|
|
|
let managerTelephone = "19270949446" |
|
|
|
let managerPassword = "123456" |
|
|
|
let userTelephone = "38580151200" |
|
|
|
let userPassword = "385801" |
|
|
|
let userStartTime = "20210813010101" |
|
|
|
let userEndTime = "20680813010101" |
|
|
|
let fpDataLength = 2048 |
|
|
|
let fpStartTime = "20210813010101" |
|
|
|
let fpEndTime = "20680813010101" |
|
|
|
let times = 255 |
|
|
|
let recycleTime = 65535 |
|
|
|
|
|
|
|
this.startFingerprint(managerTelephone, managerPassword, userTelephone, userPassword, userStartTime, userEndTime, |
|
|
|
fpDataLength, fpStartTime, fpEndTime, times, recycleTime) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//获取输入框的数据
|
|
|
|
getmsg(event){ |
|
|
|
this.setData({ |
|
|
@ -44,7 +63,7 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
btntest3(event){ |
|
|
|
btntest4(event){ |
|
|
|
var that = this; |
|
|
|
this.closeblue() |
|
|
|
}, |
|
|
@ -129,6 +148,73 @@ Page({ |
|
|
|
console.log(b) |
|
|
|
app.globalData.ble.send(cmd, b, length) |
|
|
|
}, |
|
|
|
|
|
|
|
startFingerprint(managerTelephone, managerPassword, userTelephone, userPassword, userStartTime, userEndTime, |
|
|
|
fpDataLength, fpStartTime, fpEndTime, times, recycleTime) { |
|
|
|
|
|
|
|
wx.showLoading({ |
|
|
|
title: "正在发送...", |
|
|
|
}); |
|
|
|
setTimeout(() => { |
|
|
|
wx.hideLoading() |
|
|
|
}, 1000); |
|
|
|
|
|
|
|
let cmd = 0x87 |
|
|
|
let mt = util.stringToUint8Array(managerTelephone) |
|
|
|
let mp = util.stringToUint8Array(managerPassword) |
|
|
|
let ut = util.stringToUint8Array(userTelephone) |
|
|
|
let up = util.stringToUint8Array(userPassword) |
|
|
|
|
|
|
|
let ust = util.time40ToBytes(userStartTime) |
|
|
|
let uet = util.time40ToBytes(userEndTime) |
|
|
|
|
|
|
|
let fpPacketCount = (fpDataLength+511)/512 |
|
|
|
|
|
|
|
let crc = 0xAAFF46D3; |
|
|
|
|
|
|
|
let fst = util.time40ToBytes(fpStartTime) |
|
|
|
let fet = util.time40ToBytes(fpEndTime) |
|
|
|
|
|
|
|
let length = 1 + 11 + 6 + 11 + 6 + 5 + 5 + 4 + 4 + 4 + 5 + 5 + 1 + 2 |
|
|
|
|
|
|
|
let b = new Uint8Array(length) |
|
|
|
|
|
|
|
b[0] = cmd |
|
|
|
b.set(mt, 1) |
|
|
|
b.set(mp, 12) |
|
|
|
b.set(ut, 18) |
|
|
|
b.set(up, 29) |
|
|
|
b.set(ust, 35) |
|
|
|
b.set(uet, 40) |
|
|
|
|
|
|
|
b[45] = (fpDataLength>>24)&0xff; |
|
|
|
b[46] = (fpDataLength>>16)&0xff; |
|
|
|
b[47] = (fpDataLength>>8)&0xff; |
|
|
|
b[48] = fpDataLength&0xff; |
|
|
|
|
|
|
|
b[49] = (fpPacketCount>>24)&0xff; |
|
|
|
b[50] = (fpPacketCount>>16)&0xff; |
|
|
|
b[51] = (fpPacketCount>>8)&0xff; |
|
|
|
b[52] = fpPacketCount&0xff; |
|
|
|
|
|
|
|
b[53] = (crc>>24)&0xff; |
|
|
|
b[54] = (crc>>16)&0xff; |
|
|
|
b[55] = (crc>>8)&0xff; |
|
|
|
b[56] = crc&0xff; |
|
|
|
|
|
|
|
b.set(fst, 57) |
|
|
|
b.set(fet, 62) |
|
|
|
|
|
|
|
b[67] = times; |
|
|
|
|
|
|
|
b[68] = (recycleTime>>8)&0xff; |
|
|
|
b[69] = recycleTime&0xff; |
|
|
|
|
|
|
|
console.log(b) |
|
|
|
app.globalData.ble.send(cmd, b, length) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|