|
|
@ -80,8 +80,8 @@ Page({
|
|
|
|
console.log("advertisData: ",hexStr)
|
|
|
|
console.log("advertisData: ",hexStr)
|
|
|
|
// 连接指定设备
|
|
|
|
// 连接指定设备
|
|
|
|
// if(device.deviceId=="03:02:02:07:65:98"){
|
|
|
|
// if(device.deviceId=="03:02:02:07:65:98"){
|
|
|
|
if(device.deviceId=="03:02:02:07:5F:AF"){
|
|
|
|
// if(device.deviceId=="03:02:02:07:5F:AF"){
|
|
|
|
// if(device.deviceId=="03:02:02:07:64:B4"){
|
|
|
|
if(device.deviceId=="03:02:02:07:64:B4"){
|
|
|
|
this.connectToDevice(device.deviceId);
|
|
|
|
this.connectToDevice(device.deviceId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -335,7 +335,7 @@ Page({
|
|
|
|
sendHealthCommand(){
|
|
|
|
sendHealthCommand(){
|
|
|
|
// 指令依次是:心率,血氧、血压、体温、睡眠、步数
|
|
|
|
// 指令依次是:心率,血氧、血压、体温、睡眠、步数
|
|
|
|
// 0x55,0x66,0x56,0x65,0x53,0x52
|
|
|
|
// 0x55,0x66,0x56,0x65,0x53,0x52
|
|
|
|
const commands = [0x53];
|
|
|
|
const commands = [0x55];
|
|
|
|
// 递归发送命令并加上 5 秒延迟
|
|
|
|
// 递归发送命令并加上 5 秒延迟
|
|
|
|
function sendNextCommand(index = 0) {
|
|
|
|
function sendNextCommand(index = 0) {
|
|
|
|
if (index >= commands.length) return; // 所有命令发送完毕,结束
|
|
|
|
if (index >= commands.length) return; // 所有命令发送完毕,结束
|
|
|
@ -389,7 +389,15 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 清除历史数据
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
removeHistoryData(){
|
|
|
|
|
|
|
|
let basicPacket = DataPacket.removeHistoryData();
|
|
|
|
|
|
|
|
let hex = this.uint8ArrayToHex(basicPacket);
|
|
|
|
|
|
|
|
console.log('绑定时清除历史数据:', hex);
|
|
|
|
|
|
|
|
SendCommandUtil.sendPackage(this.data.deviceId,basicPacket);
|
|
|
|
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 佩戴管理设置
|
|
|
|
* 佩戴管理设置
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|