Forráskód Böngészése

添加教具运动状态指令

chaooo 1 éve
szülő
commit
846c8d6057
2 módosított fájl, 14 hozzáadás és 5 törlés
  1. 3 1
      src/pages/start/index.vue
  2. 11 4
      src/utils/bluetooth.js

+ 3 - 1
src/pages/start/index.vue

@@ -461,7 +461,9 @@ export default {
         let $toy_sn = game_store.getters.getToySn().toUpperCase();
         if($toy_sn.includes("SW") || $toy_sn.includes("KL") || $toy_sn.includes("SC")){
           // 设置教具为无运动状态 AA CC 03 00 00 00 34 CKS
-          $this.$bluetooth.SendOrder("34");
+          $this.$bluetooth.SendMotionOrder("00");
+        } else {
+          $this.$bluetooth.SendMotionOrder("01");
         }
       },1000);
       // 开始倒计时

+ 11 - 4
src/utils/bluetooth.js

@@ -853,10 +853,8 @@ export default {
   },
 
   /**
-   * todo 打开或关闭LED灯
-   * AA CC 03 00 00 ctrl EC CKS
-   * @param id 末尾id
-   * @constructor
+   * 打开或关闭LED灯 AA CC 03 00 00 ctrl EC CKS
+   * 00/01
    */
   SendLedOrder(id) {
     let $hexStr = `03 00 00 ${id} ec`;
@@ -864,6 +862,15 @@ export default {
   },
 
   /**
+   * 设置教具为无运动状态 AA CC 03 00 00 00 34 CKS
+   * 00/01
+   */
+  SendMotionOrder(id) {
+    let $hexStr = `03 00 00 ${id} 34`;
+    this.WriteBufferInBle($hexStr)
+  },
+
+  /**
    * todo 解析hex
    * @param hexStr
    * @param byte_count