蓝牙重复初始化问题

This commit is contained in:
lishuo 2022-06-08 18:27:16 +08:00
parent 1c9102fbdc
commit 5b54255777

View File

@ -35,7 +35,7 @@ namespace Assets.Scripts.Devices.Ble
this.managerStatusChanged -= value; this.managerStatusChanged -= value;
} }
} }
WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOff; WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOn;
internal BleMobileThread() { internal BleMobileThread() {
var self = this; var self = this;
//初始蓝牙 //初始蓝牙
@ -69,6 +69,7 @@ namespace Assets.Scripts.Devices.Ble
public void StartWatcher() { public void StartWatcher() {
var self = this; var self = this;
statusEnum = WclBleManagerStatus.RadioOn;
if (statusEnum == WclBleManagerStatus.RadioOff) if (statusEnum == WclBleManagerStatus.RadioOff)
{ {
BluetoothLEHardwareInterface.BluetoothEnable(true); BluetoothLEHardwareInterface.BluetoothEnable(true);