解决蓝牙卡顿问题

This commit is contained in:
suntao committed 2021-06-08 10:30:26 +08:00
1 parent 432e02e3de
commit aa75bb281f
14 files changed
+409 -319

No files matched your search

@@ -33,7 +33,6 @@ namespace Assets.Scripts.Devices.Ble.Devices
foreach (var service in this.Services)
{
//Debug.Log($"11111 "+ service.Id.ToString());
hwInterface.DiscoverCharacteristic(service, (hwInterface, service1, response) =>
{
foreach (var character in response.Data)
@@ -47,7 +46,7 @@ namespace Assets.Scripts.Devices.Ble.Devices
continue;
}
}
foreach (var item in Characteristics.Where(c=>c.IsOptional))
foreach (var item in Characteristics.Where(c => c.IsOptional))
{
//Debug.Log(item.GetType() + "服务可用"+ item.Uuid.ToString() +", service:" + item.ServiceUuid);
var ccc = response.Data.FirstOrDefault(r => r.MatchGuid(item.Uuid));
@@ -58,7 +57,7 @@ namespace Assets.Scripts.Devices.Ble.Devices
else
{
Debug.Log(item.GetType() + "服务可用");
GetBatteryLevel(ccc);
}
}