mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Version 3.0.340
This commit is contained in:
parent
52c9f6f1d9
commit
bad07e1ec9
62 changed files with 1401 additions and 1000 deletions
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
41
LockItShared/Services/BluetoothLock/Tdo/VersionInfoTdo.cs
Normal file
41
LockItShared/Services/BluetoothLock/Tdo/VersionInfoTdo.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue