2021-05-13 17:07:16 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
2021-05-13 17:07:16 +02:00
|
|
|
|
using TINK.Services.BluetoothLock.Tdo;
|
|
|
|
|
|
|
|
|
|
namespace TINK.Services.BluetoothLock
|
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
|
public interface ILocksService
|
|
|
|
|
{
|
|
|
|
|
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
|
|
|
|
ITimeOutProvider TimeOut { get; set; }
|
2021-05-13 17:07:16 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary> Gets lock info for all lock in reach./// </summary>
|
|
|
|
|
/// <param name="connectTimeout">Timeout for connect operation of a single lock.</param>
|
|
|
|
|
Task<IEnumerable<LockInfoTdo>> GetLocksStateAsync(
|
|
|
|
|
IEnumerable<LockInfoAuthTdo> locksInfo,
|
|
|
|
|
TimeSpan connectTimeout);
|
2021-05-13 17:07:16 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary> Connects to lock.</summary>
|
|
|
|
|
/// <param name="authInfo"> Info required to connect to lock.</param>
|
|
|
|
|
/// <param name="connectTimeout">Timeout for connect operation.</param>
|
|
|
|
|
Task<LockInfoTdo> ConnectAsync(
|
|
|
|
|
LockInfoAuthTdo authInfo,
|
|
|
|
|
TimeSpan connectTimeout);
|
2021-05-13 17:07:16 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary>Gets a lock by bike Id.</summary>
|
|
|
|
|
/// <param name="bikeId"></param>
|
|
|
|
|
/// <returns>Lock object</returns>
|
|
|
|
|
ILockService this[int bikeId] { get; }
|
2021-05-13 17:07:16 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary> Disconnects lock.</summary>
|
|
|
|
|
/// <param name="bikeId"> Id of lock to disconnect.</param>
|
|
|
|
|
/// <param name="bikeGuid"> Guid of lock to disconnect.</param>
|
|
|
|
|
/// <returns> State disconnected it lock is already disconneced or after successfully disconnecting.</returns>
|
|
|
|
|
Task<LockingState> DisconnectAsync(int bikeId, Guid bikeGuid);
|
|
|
|
|
}
|
2021-05-13 17:07:16 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary> Alarm types types. </summary>
|
|
|
|
|
/// <remarks> Api-doc v29.0 </remarks>
|
|
|
|
|
public enum AlarmSettings
|
|
|
|
|
{
|
|
|
|
|
SmallSensivity = 2,
|
|
|
|
|
SmallSensivitySilent = 3,
|
|
|
|
|
SmallSensitivityPrealarm = 22,
|
|
|
|
|
MediumSensivity = 4,
|
|
|
|
|
MediumSensivitySilent = 0x05,
|
|
|
|
|
MediumSensivityPrealarm = 0x24,
|
|
|
|
|
HightestSensivity = 0x10,
|
|
|
|
|
HightestSensivitySilent = 0x11,
|
|
|
|
|
HightestSensivityPrealarm = 0x30,
|
|
|
|
|
}
|
2022-01-22 18:28:01 +01:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary> Sound types. </summary>
|
|
|
|
|
/// <remarks> Api-doc v29.0 </remarks>
|
|
|
|
|
public enum SoundSettings
|
|
|
|
|
{
|
|
|
|
|
OnLockingStartedWarn = 0x00,
|
|
|
|
|
Warn = 0x01,
|
|
|
|
|
LockingStarted = 0x02,
|
|
|
|
|
AllOff = 0x03, // Mute
|
|
|
|
|
OpenedSuccessfully = 0x04,
|
|
|
|
|
LockingStartedOpenedSuccessfully = 0x05,
|
|
|
|
|
AllOn = 0x06, // All sounds on
|
|
|
|
|
OpenedSuccessfullyWarn = 0x07,
|
|
|
|
|
}
|
2021-05-13 17:07:16 +02:00
|
|
|
|
}
|