移动端蓝牙优化
This commit is contained in:
1 parent
72f254af2a
commit
2f64aa494f
10 files changed
+84
-16
No files matched your search
@@ -35,7 +35,7 @@ namespace Assets.Scripts.Devices.Ble
|
||||
this.managerStatusChanged -= value;
|
||||
}
|
||||
}
|
||||
WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOn;
|
||||
WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOff;
|
||||
internal BleMobileThread() {
|
||||
var self = this;
|
||||
//初始蓝牙
|
||||
@@ -69,12 +69,12 @@ namespace Assets.Scripts.Devices.Ble
|
||||
|
||||
public void StartWatcher() {
|
||||
var self = this;
|
||||
statusEnum = WclBleManagerStatus.RadioOn;
|
||||
if (statusEnum == WclBleManagerStatus.RadioOff)
|
||||
{
|
||||
BluetoothLEHardwareInterface.BluetoothEnable(true);
|
||||
BluetoothLEHardwareInterface.Initialize(true, false, () =>
|
||||
{
|
||||
statusEnum = WclBleManagerStatus.RadioOn;
|
||||
managerInitialized?.Invoke(self);
|
||||
BluetoothLEHardwareInterface.ScanForPeripheralsWithServices(ServiceUuids.GetServiceUuidList().ToArray(), null, (address, name, rssi, bytes) =>
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user