فهرست منبع

feature: 蓝牙设备给mac地址

Damon 7 ماه پیش
والد
کامیت
1187c8e039
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      devices/ble_manager.js

+ 4 - 4
devices/ble_manager.js

@@ -56,7 +56,7 @@ class bleManager {
       if (res.deviceId) {
         if (that.callBackConnect != null) {
           if (that.connectWillDevice != null && res.name == that.connectWillDevice.clientType) {
-            res.advertisData = res.advertisData ? that.buf2hex(res.advertisData) : '';
+            res.mac = res.advertisData ? that.buf2hex(res.advertisData) : '';
             if (that.callBackConnect != null) {
               that.callBackConnect(res);
             }
@@ -86,7 +86,7 @@ class bleManager {
           for (var i = 0; i < res.devices.length; i++) {
             var temp = res.devices[i];
             if (that.connectWillDevice != null && temp.name == that.connectWillDevice.clientType) {
-              temp.advertisData = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
+              temp.mac = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
               if (that.callBackConnect != null) {
                 that.callBackConnect(temp);
               }
@@ -118,7 +118,7 @@ class bleManager {
       else if (res[0]) {
         if (that.callBackConnect != null) {
           if (that.connectWillDevice != null && res[0].name == that.connectWillDevice.clientType) {
-            res[0].advertisData = res[0].advertisData ? that.buf2hex(res[0].advertisData) : '';
+            res[0].mac = res[0].advertisData ? that.buf2hex(res[0].advertisData) : '';
             if (that.callBackConnect != null) {
               that.callBackConnect(res[0]);
             }
@@ -154,7 +154,7 @@ class bleManager {
           for (var i = 0; i < res.devices.length; i++) {
             var temp = res.devices[i];
             if (that.connectWillDevice != null && temp.name == that.connectWillDevice.clientType) {
-              temp.advertisData = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
+              temp.mac = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
               if (that.callBackConnect != null) {
                 that.callBackConnect(temp);
               }