mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 20:46:28 +02:00
Initial version.
This commit is contained in:
commit
6bab491a21
40 changed files with 1812 additions and 0 deletions
58
LockItShared/Services/BluetoothLock/ILockService.cs
Normal file
58
LockItShared/Services/BluetoothLock/ILockService.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Services.BluetoothLock.Tdo;
|
||||
|
||||
namespace TINK.Services.BluetoothLock
|
||||
{
|
||||
public enum DeviceState
|
||||
{
|
||||
Disconnected = 0,
|
||||
Connecting = 1,
|
||||
Connected = 2,
|
||||
Limited = 3 /* Mactches Connecting? */
|
||||
}
|
||||
|
||||
public interface ILockService
|
||||
{
|
||||
/// <summary> Reconnect to lock. </summary>
|
||||
Task ReconnectAsync(
|
||||
LockInfoAuthTdo authInfo,
|
||||
TimeSpan connectTimeout);
|
||||
|
||||
/// <summary> Opens lock. </summary>
|
||||
/// <returns> State of lock after performing open operation. </returns>
|
||||
Task<LockitLockingState?> OpenAsync();
|
||||
|
||||
/// <summary> Closes lock. </summary>
|
||||
/// <returns>State of lock after performing close operation.</returns>
|
||||
Task<LockitLockingState?> CloseAsync();
|
||||
|
||||
string Name { get; }
|
||||
|
||||
Guid Guid { get; }
|
||||
|
||||
int Id { get; }
|
||||
|
||||
/// <summary> Gets the device state.</summary>
|
||||
DeviceState? GetDeviceState();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the locking state.
|
||||
/// </summary>
|
||||
/// <param name="doWaitRetry">True if to wait and retry in case of failures. </param>
|
||||
/// <returns></returns>
|
||||
Task<LockInfoTdo> GetLockStateAsync(bool doWaitRetry = false);
|
||||
|
||||
Task<bool> SetSoundAsync(SoundSettings settings);
|
||||
|
||||
Task<bool> GetIsAlarmOffAsync();
|
||||
|
||||
Task SetIsAlarmOffAsync(bool isActivated);
|
||||
|
||||
/// <summary>Gets the battery percentage.</summary>
|
||||
Task<double> GetBatteryPercentageAsync();
|
||||
|
||||
/// <summary> Disconnect from lock.</summary>
|
||||
Task Disconnect();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue