解决io设备连接&android卡顿问题
This commit is contained in:
1 parent
342740b740
commit
a588716b30
8 files changed
+13
-41
No files matched your search
@@ -126,15 +126,8 @@ namespace Assets.Scripts.Devices.Ble
|
||||
if (this.State != DeviceState.Disconnected)
|
||||
{
|
||||
Debug.Log("断开设备" + this.Name);
|
||||
|
||||
//App.MainDeviceAdapter.PrintStatus();
|
||||
//this.State = DeviceState.Disconnected;
|
||||
|
||||
this.hwInterface.DisconnectPeripheral(this.peripheralInfo, () => {
|
||||
//App.MainDeviceAdapter.PrintStatus();
|
||||
|
||||
this.State = DeviceState.Disconnected;
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -247,8 +240,6 @@ namespace Assets.Scripts.Devices.Ble
|
||||
|
||||
public override void Disconnect(bool save = true)
|
||||
{
|
||||
//throw new NotImplementedException();
|
||||
//this.hwInterface.DisconnectPeripheral(this.peripheralInfo, null);
|
||||
this.Disconnect();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Assets.Scripts.Devices.Ble
|
||||
|
||||
private void HwInterface_BluetoothStateChangedEvent(IBleWinHwInterface hwInterface, BleState bleState)
|
||||
{
|
||||
//Debug.Log("22222222222222" + bleState);
|
||||
if(bleState == BleState.Off)
|
||||
{
|
||||
discoveredDevices.Clear();
|
||||
@@ -136,20 +135,7 @@ namespace Assets.Scripts.Devices.Ble
|
||||
//TODO:取消注释,自动连接设备
|
||||
//Debug.Log("自动连接" + device111.Id);
|
||||
|
||||
if (App.IsRowerMode == true)
|
||||
{
|
||||
if (device111.Sensor == Ant.SensorType.Rower || device111.Sensor == Ant.SensorType.HeartRate)
|
||||
{
|
||||
device111.Connect();
|
||||
}
|
||||
}
|
||||
else if(App.IsRowerMode == false)
|
||||
{
|
||||
if (device111.Sensor != Ant.SensorType.Rower)
|
||||
{
|
||||
device111.Connect();
|
||||
}
|
||||
}
|
||||
device111.Connect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user