using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using TINK.Model.Bike.BluetoothLock;
using TINK.Services.BluetoothLock.Tdo;
namespace TINK.Services.BluetoothLock
{
public interface ILocksService
{
/// Holds timeout values for series of connecting attemps to a lock or multiple locks.
ITimeOutProvider TimeOut { get; set; }
/// Gets lock info for all lock in reach.///
/// Timeout for connect operation of a single lock.
Task> GetLocksStateAsync(
IEnumerable locksInfo,
TimeSpan connectTimeout);
/// Connects to lock.
/// Info required to connect to lock.
/// Timeout for connect operation.
Task ConnectAsync(
LockInfoAuthTdo authInfo,
TimeSpan connectTimeout);
/// Gets a lock by bike Id.
///
/// Lock object
ILockService this[int bikeId] { get; }
/// Disconnects lock.
/// Id of lock to disconnect.
/// Guid of lock to disconnect.
/// State disconnected it lock is already disconneced or after successfully disconnecting.
Task DisconnectAsync(int bikeId, Guid bikeGuid);
}
/// Alarm types types.
/// Api-doc v29.0
public enum AlarmSettings
{
SmallSensivity = 2,
SmallSensivitySilent = 3,
SmallSensitivityPrealarm = 22,
MediumSensivity = 4,
MediumSensivitySilent = 0x05,
MediumSensivityPrealarm = 0x24,
HightestSensivity = 0x10,
HightestSensivitySilent = 0x11,
HightestSensivityPrealarm = 0x30,
}
/// Sound types.
/// Api-doc v29.0
public enum SoundSettings
{
OnLockingStartedWarn = 0x00,
Warn = 0x01,
LockingStarted = 0x02,
AllOff = 0x03, // Mute
OpenedSuccessfully = 0x04,
LockingStartedOpenedSuccessfully = 0x05,
AllOn = 0x06, // All sounds on
OpenedSuccessfullyWarn = 0x07,
}
}