using System;
using System.Threading.Tasks;
using ShareeBike.Services.BluetoothLock.Tdo;
namespace ShareeBike.Services.BluetoothLock
{
public enum DeviceState
{
Disconnected = 0,
Connecting = 1,
Connected = 2,
Limited = 3 /* Mactches Connecting? */
}
public interface ILockService
{
/// Reconnect to lock.
Task ReconnectAsync(
LockInfoAuthTdo authInfo,
TimeSpan connectTimeout);
/// Opens lock.
/// State of lock after performing open operation.
Task OpenAsync();
/// Closes lock.
/// State of lock after performing close operation.
Task CloseAsync();
string Name { get; }
Guid Guid { get; }
int Id { get; }
/// Gets the device state.
DeviceState? GetDeviceState();
///
/// Gets the locking state.
///
/// True if to wait and retry in case of failures.
///
Task GetLockStateAsync(bool doWaitRetry = false);
Task SetSoundAsync(SoundSettings settings);
Task SetAlarmSettingsAsync(AlarmSettings settings);
Task GetIsAlarmOffAsync();
///
/// Get info about lock firmware- hardware- and lock-version.
///
/// Lock versions info.
Task GetVersionInfoAsync();
///
/// Holds info about lock firmware- hardware- and lock-version, null if info has not yet been read.
///
VersionInfoTdo VersionInfo { get; }
Task SetIsAlarmOffAsync(bool isActivated);
/// Gets the battery percentage.
Task GetBatteryPercentageAsync();
/// Disconnect from lock.
Task Disconnect();
}
}