Merge remote-tracking branch 'origin/dev_lishuo' into dev
This commit is contained in:
commit
1020632757
15 files changed
+139
-67
No files matched your search
@@ -11,11 +11,12 @@ using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.Devices.Ble.Devices
|
||||
{
|
||||
public class Tacx : BleDevice, IPowerDevice, ICadenceDevice, ISpeedDevice, ITrainerDevice
|
||||
public class Tacx : BleDevice, IPowerDevice, ICadenceDevice, ISpeedDevice, ITrainerDevice, IRequiresRiderWeight
|
||||
{
|
||||
public int Power { get => tacxFecNotify.Power; set => throw new NotImplementedException(); }
|
||||
public int Cadence { get => tacxFecNotify.Cadence; set => throw new NotImplementedException(); }
|
||||
public double Speed { get => tacxFecNotify.Speed; set => throw new NotImplementedException(); }
|
||||
public double RiderWeight { get; set; }
|
||||
|
||||
private List<BleServiceInfo> Services;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Assets.Scripts.Devices.Ant;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -171,6 +172,24 @@ namespace Assets.Scripts.Ble
|
||||
return ServiceUuids.Services.Single(s => s.IdByteArray == type);
|
||||
}
|
||||
|
||||
public static Guid GetBySensor(SensorType sensor)
|
||||
{
|
||||
switch (sensor)
|
||||
{
|
||||
case SensorType.Cadence:
|
||||
case SensorType.SpeedCadence:
|
||||
return Get(ServiceUuids.CyclingSpeedCadence).IdGuid;
|
||||
case SensorType.HeartRate:
|
||||
return Get(ServiceUuids.HeartRate).IdGuid;
|
||||
case SensorType.Power:
|
||||
return Get(ServiceUuids.PowerBeam).IdGuid;
|
||||
case SensorType.Trainer:
|
||||
return Get(ServiceUuids.TacxBle).IdGuid;
|
||||
default:
|
||||
return Guid.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Characteristics
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user