mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Initial version.
This commit is contained in:
commit
6bab491a21
40 changed files with 1812 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class AlreadyConnectedException : System.Exception
|
||||
{
|
||||
public AlreadyConnectedException() : base("Invalid reconnect call detected. Device is already connected.") {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class AuthKeyException : System.Exception
|
||||
{
|
||||
public AuthKeyException(string message) : base(message)
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
using TINK.Model.Bike.BluetoothLock;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class BluetoothDisconnectedException : StateAwareException
|
||||
{
|
||||
public BluetoothDisconnectedException() : base(LockingState.Disconnected, MultilingualResources.Resources.ErrorBluetoothDisconnectedException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using TINK.Model.Bike.BluetoothLock;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CouldntCloseBoldBlockedException : StateAwareException
|
||||
{
|
||||
public CouldntCloseBoldBlockedException() : base(
|
||||
LockingState.Unknown, // Lock is closed in most cases, but this is not guarnteed according to haveltec.
|
||||
MultilingualResources.Resources.ErrorCloseLockBoldBlocked)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.MultilingualResources;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CouldntCloseInconsistentStateExecption : StateAwareException
|
||||
{
|
||||
public CouldntCloseInconsistentStateExecption(LockingState state) :
|
||||
base(
|
||||
state,
|
||||
state != LockingState.Unknown
|
||||
? string.Format(Resources.ErrorCloseLockUnexpectedState, state)
|
||||
: Resources.ErrorCloseLockUnknownPosition)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using TINK.Model.Bike.BluetoothLock;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CouldntOpenBoldBlockedException : StateAwareException
|
||||
{
|
||||
public CouldntOpenBoldBlockedException() : base(
|
||||
LockingState.Unknown, //
|
||||
MultilingualResources.Resources.ErrorOpenLockBoldBlocked)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.MultilingualResources;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CouldntOpenInconsistentStateExecption : StateAwareException
|
||||
{
|
||||
public CouldntOpenInconsistentStateExecption(LockingState state) :
|
||||
base(
|
||||
state,
|
||||
state != LockingState.Unknown
|
||||
? string.Format(Resources.ErrorOpenLockUnexpectedState, state)
|
||||
: Resources.ErrorOpenLockUnknownPosition)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CoundntGetCharacteristicException : System.Exception
|
||||
{
|
||||
public CoundntGetCharacteristicException(string message) : base(message)
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock.Tdo;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class CounldntCloseMovingException : StateAwareException
|
||||
{
|
||||
public CounldntCloseMovingException() : base(
|
||||
LockingState.Open, // Locking bold is probable (according to haveltec) still open.
|
||||
MultilingualResources.Resources.ErrorCloseLockBikeMoving)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public class GuidUnknownException : System.Exception
|
||||
{
|
||||
public GuidUnknownException() : base("Can not connect to lock. No Guid available.")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
/// <summary> Thrown whenever lock is out of reach.</summary>
|
||||
public class OutOfReachException : System.Exception
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using TINK.Model.Bike.BluetoothLock;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.Exception
|
||||
{
|
||||
public abstract class StateAwareException : System.Exception
|
||||
{
|
||||
public StateAwareException(LockingState state, string description) : base(description)
|
||||
{
|
||||
State = state;
|
||||
}
|
||||
|
||||
/// <summary> Holds the state reported by lock.</summary>
|
||||
public LockingState State { get; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue