支持蓝牙可用状态变更。搜索不到设备自动停止当前线程。

This commit is contained in:
suntao committed 2021-06-10 17:46:43 +08:00
1 parent dd474f1f61
commit 734893ff83
27 files changed
+290 -143

No files matched your search

@@ -36,9 +36,13 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
public void HandleAttributeReceived(byte[] data)
{
if(data.Length < 1)
{
return;
}
BatteryLevelValue = (int)data[0];
Debug.Log($"电量:{ BatteryLevelValue }");
//Debug.Log($"电量:{ BatteryLevelValue }");
}
public void SetUnavailable()
@@ -20,7 +20,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
public void HandleAttributeReceived(byte[] data)
{
//throw new NotImplementedException();
Debug.Log(Encoding.UTF8.GetString(data));
//Debug.Log(Encoding.UTF8.GetString(data));
}
public void SetUnavailable()
@@ -20,7 +20,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
public void HandleAttributeReceived(byte[] data)
{
//throw new NotImplementedException();
Debug.Log($"model number:\t{ Encoding.UTF8.GetString(data) }");
//Debug.Log($"model number:\t{ Encoding.UTF8.GetString(data) }");
}
public void SetUnavailable()