|
@@ -233,7 +233,7 @@ export default {
|
|
|
const that = this;
|
|
|
wx.onBLECharacteristicValueChange((characteristic) => {
|
|
|
let hexStr = that.ab2hex(characteristic.value);
|
|
|
- if (hexStr.toUpperCase().indexOf("AADD")!=-1){
|
|
|
+ if (hexStr.toUpperCase().indexOf("AADD") != -1) {
|
|
|
console.log(hexStr);
|
|
|
}
|
|
|
let $data = that.get_big_data(hexStr);
|
|
@@ -261,13 +261,17 @@ export default {
|
|
|
wx.showToast({
|
|
|
title: "已连接到" + $this.toy_item.name
|
|
|
});
|
|
|
+ $this.toy_connected = true;
|
|
|
$this.change_toy_connect_status(2);
|
|
|
+
|
|
|
+ that.SendOrder('8a')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (hexStr.toUpperCase().indexOf("AADD8A") != -1) {
|
|
|
let $_hexStr = hexStr.substr(6);
|
|
|
let $power = parseInt($_hexStr.substr(0, 2), 16)
|
|
@@ -289,35 +293,32 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
- if (hexStr.toUpperCase().indexOf("AADD84") != -1) {
|
|
|
- let $_hexStr = hexStr.substr(6);
|
|
|
- let $datas = $_hexStr.substr(0, 10);
|
|
|
- if ($datas != "0000000000") {
|
|
|
- $this.toy_UUID = $datas;
|
|
|
-
|
|
|
- that.SendOrder('8a')
|
|
|
- } else {
|
|
|
-
|
|
|
- if ($game_status == 1) {
|
|
|
-
|
|
|
- console.log($this.toy_UUID)
|
|
|
- console.log(`aa cc 03 00 ${$this.toy_hex} 02 0a`)
|
|
|
- } else {
|
|
|
- $this.toy_UUID = ""
|
|
|
- $this.toy_power = 0;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
let $power = that.get_device_elc(hexStr);
|
|
|
if ($power) {
|
|
|
-
|
|
|
- that.SendOrder("84");
|
|
|
-
|
|
|
|
|
|
$this.device_power = $power;
|
|
|
}
|
|
@@ -341,9 +342,10 @@ export default {
|
|
|
game_store.setters.setPlayedTime($this.played_time)
|
|
|
$this.played_time_text = that.formatPlaySeconds($this.played_time);
|
|
|
$this.do_datas($data);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if ($this.played_time % 10 == 0) {
|
|
|
+
|
|
|
+ that.SendOrder('8a')
|
|
|
+ }
|
|
|
}
|
|
|
if ($this.played_time == 0) {
|
|
|
$this.post_data();
|
|
@@ -416,7 +418,7 @@ export default {
|
|
|
return $errmsg;
|
|
|
},
|
|
|
|
|
|
- WriteBufferInBle($hex,$buffer_len = 8) {
|
|
|
+ WriteBufferInBle($hex, $buffer_len = 8) {
|
|
|
let $device_id = game_store.getters.getDeviceId();
|
|
|
let $service_id = game_store.getters.getServiceId()
|
|
|
let $charateristic = game_store.getters.getCharacterId();
|