实现连接设备界面

This commit is contained in:
suntao committed 2021-04-01 11:09:53 +08:00
1 parent 996f924719
commit ec7589096f
88 files changed
+11344 -156

No files matched your search

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Devices.Ant.Pages.CalibrationPages
{
public class CtfCalibrationPage : ICalibrationPage
{
public bool CanHandle(byte calibrationId)
{
return (int)calibrationId == 16;
}
public void Handle(byte[] dataPayload, AbstractAntDevice device)
{
var powerDevice = device as PowerDevice;
if (powerDevice == null || (int)dataPayload[2] != 1)
return;
//参考类CtfCalibrationResult
var offset = (int)((int)dataPayload[7] | (int)dataPayload[6] << 8);
powerDevice.DoCalibrationSuccess(offset, AutoZeroStatus.NotSupported);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14c60f86d0918cf4d9656359561b9c7d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Devices.Ant.Pages.CalibrationPages
{
/// <summary>
/// 校准失败的处理函数
/// </summary>
public class FailureCalibrationPage : ICalibrationPage
{
public bool CanHandle(byte calibrationId)
{
return (int)calibrationId == 175;
}
public void Handle(byte[] dataPayload, AbstractAntDevice device)
{
var powerDevice = device as PowerDevice;
if (powerDevice == null)
return;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87c2482dbcf031e488a6dd7cfc3b475b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Devices.Ant.Pages.CalibrationPages
{
/// <summary>
/// 校准成功的处理函数
/// </summary>
public class SuccessCalibrationPage : ICalibrationPage
{
public bool CanHandle(byte calibrationId)
{
return (int)calibrationId == 172;
}
public void Handle(byte[] dataPayload, AbstractAntDevice device)
{
//throw new NotImplementedException();
var powerDevice = device as PowerDevice;
if (powerDevice == null)
return;
var autoZeroStatus = (AutoZeroStatus)dataPayload[2];
var offset = (int)((int)dataPayload[7] << 8 | (int)dataPayload[6]);
powerDevice.DoCalibrationSuccess(offset, autoZeroStatus);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c45f42f53396ece499b5153107ab46da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: