接入蓝牙基本结构
This commit is contained in:
1 parent
84e8b50bbf
commit
2f84f70a5f
152 files changed
+6426
-56
No files matched your search
@@ -18,18 +18,19 @@ public class MainController : MonoBehaviour
|
||||
Version.text = "V"+App.AppVersion;
|
||||
DeviceCache.Init(PFConstants.DeviceCacheFolder);
|
||||
|
||||
AntConnector.Instance((device2) => {
|
||||
if (device2.State == DeviceState.Disconnected)
|
||||
{
|
||||
//Debug.Log($"探索到新的设备{ device2.DeviceNumber }");
|
||||
//自动连接
|
||||
if (DeviceCache.Exist(device2))
|
||||
{
|
||||
Debug.Log("自动连接" + device2.DeviceNumber);
|
||||
device2.Connect();
|
||||
}
|
||||
}
|
||||
}, Debug.Log);
|
||||
//AntConnector.Instance((device2) => {
|
||||
// if (device2.State == DeviceState.Disconnected)
|
||||
// {
|
||||
// //Debug.Log($"探索到新的设备{ device2.DeviceNumber }");
|
||||
// //自动连接
|
||||
// if (DeviceCache.Exist(device2))
|
||||
// {
|
||||
// Debug.Log("自动连接" + device2.DeviceNumber);
|
||||
// device2.Connect();
|
||||
// }
|
||||
// }
|
||||
//}, Debug.Log);
|
||||
App.MainDeviceAdapter.StartScan();
|
||||
|
||||
|
||||
//Debug.Log(Application.dataPath);
|
||||
@@ -89,6 +90,6 @@ public class MainController : MonoBehaviour
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
AntConnector.Instance().Dispose();
|
||||
App.MainDeviceAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user