sharee.bike-App/LockIt.BusinessLogic/Services/BluetoothLock/ILocksService.cs

68 lines
2.2 KiB
C#
Raw Normal View History

2023-04-19 12:14:14 +02:00
using System;
2021-05-13 17:07:16 +02:00
using System.Collections.Generic;
using System.Threading.Tasks;
2024-04-09 12:53:23 +02:00
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
using ShareeBike.Services.BluetoothLock.Tdo;
2021-05-13 17:07:16 +02:00
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Services.BluetoothLock
2021-05-13 17:07:16 +02:00
{
2022-09-06 16:08:19 +02:00
public interface ILocksService
{
2023-04-19 12:14:14 +02:00
/// <summary> Holds timeout values for series of connecting attempts to a lock or multiple locks. </summary>
2022-09-06 16:08:19 +02:00
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
}