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);
}
/// Sound types.
///
/// 1. Locking process started: One long beep.
/// 2. Unlocking successful: One short beep.
/// 3. Bike moved while trying to lock: Three short beeps.
/// 4. Locking bolt blocked while locking: Three short beeps.
/// 5. Unable to unlock because locking bolt is blocked: Three short beeps.
///
public enum SoundSettings
{
AllButOpenedSuccessfully, // Sounds: 1, 3, 4, 5
MovingBlocked = 1, // Sounds: 3, 4, 5
LockingStarted = 2, // Sounds: 1
AllOff = 3, // Mute
OpenedSuccessfully = 4, // Sounds: 2
LockingStartedOpenedSuccessfully = 5, // Sounds: 1, 2
AllOn = 6, // All sounds on
AllButLockingStarted = 7, // Sounds: 2, 3, 4, 5
}
}