Ver Fonte

蓝牙服务名区分安卓ios,关闭日志传服务器

lvjincheng há 3 anos atrás
pai
commit
dc79f12e0c

+ 22 - 4
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -12,19 +12,37 @@ public class BluetoothAim : MonoBehaviour
 
     string targetDeviceService {
         get {
-            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) return "0000fff0";
+            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) {
+                #if UNITY_ANDROID
+                return "0000fff0";
+                #else
+                return "fff0";
+                #endif
+            }
             return "6e400001";
         }
     }
     string targetDeviceCharacteristicWrite {
         get {
-            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) return "0000fff2";
+            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) {
+                #if UNITY_ANDROID
+                return "0000fff2";
+                #else
+                return "fff2";
+                #endif
+            }
             return "6e400002";
         }
     }
     string targetDeviceCharacteristicNotify {
         get {
-            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) return "0000fff1";
+            if (CommonConfig.devicePlan == 0 || CommonConfig.devicePlan == 3) {
+                #if UNITY_ANDROID
+                return "0000fff1";
+                #else
+                return "fff1";
+                #endif
+            }
             return "6e400003";
         }
     }
@@ -207,7 +225,7 @@ public class BluetoothAim : MonoBehaviour
             };
             bluetoothHelper.OnCharacteristicChanged += (helper, value, characteristic) =>
             {
-                logger.Log(String.Join(",", value));
+                // logger.Log(String.Join(",", value));
                 if (!hasData) {
                     hasDataTime = JC.CS.Utility.GetTimestamp();
                     UploadMacAddress(value);

+ 1 - 1
Assets/BowArrow/Scripts/Debug/SBLogger.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 
 public class SBLogger
 {
-    private static bool debug = true;
+    private static bool debug = false;
     private string tag;
 
     public SBLogger(string tag)