C2课程同步问题
This commit is contained in:
1 parent
84b3e1e7a4
commit
701ec3069b
8 files changed
+202
-36
No files matched your search
@@ -11,6 +11,11 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
|
||||
{
|
||||
public class C2RowerData : ICharacteristic, IRowerCommonData
|
||||
{
|
||||
public static string JUSTROW_HEX = "F1 76 07 01 01 01 13 02 01 01 61 F2";
|
||||
public static string TERMINATEWORKOUT_HEX = "F1 76 04 13 02 01 02 62 F2";
|
||||
public static string FIXEDDISTANCE_HEX = "F1 76 18 01 01 03 03 05 80 00 00 07 D0 05 05 80 00 00 01 90 14 01 01 13 02 01 01 28 F2";
|
||||
public static string FIXEDTIME_HEX = "F1 76 07 01 01 01 13 02 01 01 61 F2";
|
||||
|
||||
public Guid Uuid => ServiceUuids.Characteristics.C2RowerData35;
|
||||
|
||||
public Guid ServiceUuid => ServiceUuids.Characteristics.C2Service;
|
||||
@@ -133,17 +138,19 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
|
||||
InstantaneousPower = BitConvertHelper.ToUInt16(data, 4);
|
||||
//TotalEnergy = BitConvertHelper.ToUInt16(data, 6);
|
||||
}
|
||||
//else if (data[0] == 0x39)
|
||||
//{
|
||||
// AverageStrokeRate = (int)data[11];
|
||||
// ResistanceLevel = (int)data[16];
|
||||
//}
|
||||
else if (data[0] == 0x39)
|
||||
{
|
||||
ElapsedTime = (int)(Convert.ToDouble(BitConvertHelper.ToUInt24(data, 1)) / 100);
|
||||
TotalDistance = (uint)(Convert.ToDouble(BitConvertHelper.ToUInt24(data, 4)) / 10);
|
||||
CompleteEvent?.Invoke(this, null);
|
||||
}
|
||||
//else if (data[0] == 34)
|
||||
//{
|
||||
// isReadyStatus = data[2] == 1 || data[2] == 129;
|
||||
//}
|
||||
}
|
||||
public event EventHandler StartEvent;
|
||||
public event EventHandler CompleteEvent;
|
||||
private double LbsToNewton(double lbs,bool isKg = false) => 4.4482216 * lbs * (isKg ? (1f / 9.8f) : 1f);
|
||||
public void SetUnavailable()
|
||||
{
|
||||
|
||||
@@ -94,6 +94,8 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
|
||||
public event EventHandler PullChanged;
|
||||
//开始事件
|
||||
public event EventHandler StartEvent;
|
||||
//结束事件
|
||||
public event EventHandler CompleteEvent;
|
||||
//日志事件
|
||||
public event EventHandler LogEvent;
|
||||
private ushort _pullValue;
|
||||
|
||||
Reference in new issue
Block a user