ccj 3 years ago
parent
commit
2c59e9a05e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/views/home/index.vue

+ 3 - 3
src/views/home/index.vue

@@ -554,17 +554,17 @@ export default {
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read();
-          console.log(value,done);
+          // console.log(value,done);
           if (done) {
             // 允许稍后关闭串口。
             this.reader.releaseLock();
             break;
           }
           var result="";
-          if(value.length < 5){
-          }
+          
           for(var i=0;i<value.length;i++){
             result += String.fromCharCode(value[i])
+            console.log(result);
           }
           this.text = result
           // value 是一个 Uint8Array