Version 3.0.340

This commit is contained in:
Anja 2022-09-20 13:51:55 +02:00
parent 52c9f6f1d9
commit bad07e1ec9
62 changed files with 1401 additions and 1000 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using TINK.Services.BluetoothLock.Tdo;
@ -49,6 +49,17 @@ namespace TINK.Services.BluetoothLock
Task<bool> GetIsAlarmOffAsync();
/// <summary>
/// Get info about lock firmware- hardware- and lock-version.
/// </summary>
/// <returns>Lock versions info.</returns>
Task<VersionInfoTdo> GetVersionInfoAsync();
/// <summary>
/// Holds info about lock firmware- hardware- and lock-version, null if info has not yet been read.
/// </summary>
VersionInfoTdo VersionInfo { get; }
Task SetIsAlarmOffAsync(bool isActivated);
/// <summary>Gets the battery percentage.</summary>

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using TINK.Services.BluetoothLock.Tdo;
@ -37,6 +37,13 @@ namespace TINK.Services.BluetoothLock
public Task<double> GetBatteryPercentageAsync() =>
throw new System.Exception($"Can not get battery percentage. Lock {BikeId} not found.");
public Task<VersionInfoTdo> GetVersionInfoAsync() =>
throw new System.Exception($"Can not get versions. Lock {BikeId} not found.");
public VersionInfoTdo VersionInfo
{
get => throw new System.Exception($"Can not get versions. Lock {BikeId} not found.");
}
public DeviceState? GetDeviceState() =>
throw new NotImplementedException();

View file

@ -0,0 +1,41 @@
namespace TINK.Services.BluetoothLock.Tdo
{
public class VersionInfoTdo
{
/// <summary>
/// Holds info about firmware- and hardware version of a lock and the type of lock (lock version).
/// </summary>
private VersionInfoTdo() { }
/// <summary>
/// Holds the firmware version of the lock.
/// </summary>
public int FirmwareVersion { get; private set; }
/// <summary>
/// Holds the hardware version (revision) of the lock.
/// </summary>
public int HardwareVersion { get; private set; }
/// <summary>
/// Holds lock version (2 classic, 3 plus, 4 GPS).
/// </summary>
public int LockVersion { get; private set; }
public class Builder
{
private VersionInfoTdo lockVersionTdo = new VersionInfoTdo();
public int FirmwareVersion { get => lockVersionTdo.FirmwareVersion; set => lockVersionTdo.FirmwareVersion = value; }
public int HardwareVersion { get => lockVersionTdo.HardwareVersion; set => lockVersionTdo.HardwareVersion = value; }
public int LockVersion { get => lockVersionTdo.LockVersion; set => lockVersionTdo.LockVersion = value; }
public VersionInfoTdo Build()
{
return lockVersionTdo;
}
}
}
}