Version 3.0.381

This commit is contained in:
Anja 2024-04-09 12:53:23 +02:00
parent f963c0a219
commit 3a363acf3a
1525 changed files with 60589 additions and 125098 deletions

View file

@ -0,0 +1,7 @@
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class AlreadyConnectedException : System.Exception
{
public AlreadyConnectedException() : base("Invalid reconnect call detected. Device is already connected.") { }
}
}

View file

@ -0,0 +1,8 @@
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class AuthKeyException : System.Exception
{
public AuthKeyException(string message) : base(message)
{ }
}
}

View file

@ -0,0 +1,20 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.Services.BluetoothLock.Exception
{
/// <summary>
/// If fired if app is disconnected from bluetooth.
/// </summary>
/// <remarks>
/// Member to determine if app is disconnected: IDevice.State from server Plugin.BLE. If DeviceState.Disconnected exception is fired.
/// All possible states: Disconnected, Connecting, Connected, Limited.
/// </remarks>
public class BluetoothDisconnectedException : StateAwareException
{
public BluetoothDisconnectedException() : base(
LockingState.UnknownDisconnected,
MultilingualResources.Resources.LockItExceptionBluetoothDisconnected)
{
}
}
}

View file

@ -0,0 +1,17 @@

using ShareeBike.MultilingualResources;
namespace ShareeBike.Services.BluetoothLock.Exception
{
/// <summary> Exception which is fired when bluetooth is not on. </summary>
/// <remarks>
/// Member to determine if app is disconnected: IBluetoothLE.State from server Plugin.BLE. If current value is not BluetoothState.On exception is fired.
/// All possible states: Unknown, Unavailable, Unauthorized, TurningOn, On, TurningOff, Off.
/// </remarks>
public class ConnectBluetoothNotOnException : System.Exception
{
public ConnectBluetoothNotOnException() : base(Resources.LockItExceptionConnectLockBluetoothOffException) { }
public ConnectBluetoothNotOnException(object state) : base(string.Format(Resources.LockItExceptionConnectLockBluetoothNotOnException, state.ToString())) { }
}
}

View file

@ -0,0 +1,9 @@
using ShareeBike.MultilingualResources;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class ConnectLocationOffException : System.Exception
{
public ConnectLocationOffException() : base(Resources.LockItExceptionConnectLockLocationOffException) { }
}
}

View file

@ -0,0 +1,9 @@
using ShareeBike.MultilingualResources;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class ConnectLocationPermissionMissingException : System.Exception
{
public ConnectLocationPermissionMissingException() : base(Resources.LockItExceptionConnectLockLocationPermissingMissingException) { }
}
}

View file

@ -0,0 +1,22 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class CouldntCloseBoltBlockedException : StateAwareException
{
/// <summary>
/// Constructs a bold blocked exception.
/// </summary>
/// <remarks>
/// Lock is closed in most cases, but this is not guaranteed according to haveltec.
/// </remarks>
/// <param name="state">State of the lock while/ after bold blocked event.</param>
/// <remarks>
/// </remarks>
public CouldntCloseBoltBlockedException(LockingState state = LockingState.UnknownFromHardwareError) : base(
state,
MultilingualResources.Resources.LockItExceptionCloseLockBoltBlocked)
{
}
}
}

View file

@ -0,0 +1,18 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
using ShareeBike.MultilingualResources;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class CouldntCloseInconsistentStateExecption : StateAwareException
{
public CouldntCloseInconsistentStateExecption(LockingState state) :
base(
state,
state != LockingState.UnknownFromHardwareError
? string.Format(Resources.LockItExceptionCloseLockUnexpectedLockState, state)
: Resources.LockItExceptionCloseLockUnknownPosition)
{
}
}
}

View file

@ -0,0 +1,13 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class CouldntCloseMovingException : StateAwareException
{
public CouldntCloseMovingException() : base(
LockingState.Open, // Locking bold is probable (according to haveltec) still open.
MultilingualResources.Resources.LockItExceptionCloseLockMoving)
{
}
}
}

View file

@ -0,0 +1,16 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.Services.BluetoothLock.Exception
{
/// <summary>
/// Lock can not be opened, because bold is blocked. Lock reports that obstacle is still blocking.
/// </summary>
public class CouldntOpenBoldIsBlockedException : StateAwareException
{
public CouldntOpenBoldIsBlockedException() : base(
LockingState.UnknownFromHardwareError,
MultilingualResources.Resources.LockItExceptionOpenLockBoltBlocked)
{
}
}
}

View file

@ -0,0 +1,16 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.Services.BluetoothLock.Exception
{
/// <summary>
/// Lock can not be opened, because bold is/ was blocked. Obstacle might no more block but lock could not be opened completely to obstacle.
/// </summary>
public class CouldntOpenBoldStatusIsUnknownException : StateAwareException
{
public CouldntOpenBoldStatusIsUnknownException() : base(
LockingState.UnknownFromHardwareError,
MultilingualResources.Resources.LockItExceptionOpenLockBoldStatusIsUnknown)
{
}
}
}

View file

@ -0,0 +1,16 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
using ShareeBike.MultilingualResources;
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class CouldntOpenInconsistentStateExecption : StateAwareException
{
public CouldntOpenInconsistentStateExecption(LockingState state) :
base(
state,
string.Format(Resources.LockItExceptionOpenLockUnexpectedState, state))
{
}
}
}

View file

@ -0,0 +1,8 @@
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class CoundntGetCharacteristicException : System.Exception
{
public CoundntGetCharacteristicException(string message) : base(message)
{ }
}
}

View file

@ -0,0 +1,9 @@
namespace ShareeBike.Services.BluetoothLock.Exception
{
public class GuidUnknownException : System.Exception
{
public GuidUnknownException() : base("Can not connect to lock. No Guid available.")
{
}
}
}

View file

@ -0,0 +1,8 @@
namespace ShareeBike.Services.BluetoothLock.Exception
{
/// <summary> Thrown whenever lock is out of reach.</summary>
/// <remarks> If fired when scan for devices does not result in lock being found.</remarks>
public class OutOfReachException : System.Exception
{
}
}

View file

@ -0,0 +1,15 @@
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
namespace ShareeBike.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; }
}
}