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,61 @@
using System;
using ShareeBike.Model.Connector;
namespace ShareeBike.Services.BluetoothLock.Tdo
{
/// <summary> Data required to connect to a blutooth lock.</summary>
public class LockInfoAuthTdo
{
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get; private set; }
/// <summary> GUID to the device. </summary>
public Guid Guid { get; private set; }
/// <summary> Seed used to generate key for connecting to bluetooth lock.</summary>
public byte[] K_seed { get; private set; }
/// <summary> Key for connect to bluetooth lock as user.</summary>
public byte[] K_u { get; private set; }
/// <summary> Key for connect to bluetooth lock as admin.</summary>
public byte[] K_a { get; private set; }
public bool IsIdValid => Id != TextToLockItTypeHelper.INVALIDLOCKID;
public bool IsGuidValid => Guid != TextToLockItTypeHelper.INVALIDLOCKGUID;
public class Builder
{
private LockInfoAuthTdo lockInfoTdo = new LockInfoAuthTdo();
public Builder() { }
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get => lockInfoTdo.Id; set { lockInfoTdo.Id = value; } }
/// <summary> GUID to the device. </summary>
public Guid Guid { get => lockInfoTdo.Guid; set { lockInfoTdo.Guid = value; } }
/// <summary> Seed used to generate key for connecting to bluetooth lock.</summary>
public byte[] K_seed { get => lockInfoTdo.K_seed; set { lockInfoTdo.K_seed = value; } }
/// <summary> Key for connect to bluetooth lock as user.</summary>
public byte[] K_u { get => lockInfoTdo.K_u; set { lockInfoTdo.K_u = value; } }
/// <summary> Key for connect to bluetooth lock as admin.</summary>
public byte[] K_a { get => lockInfoTdo.K_a; set { lockInfoTdo.K_a = value; } }
public LockInfoAuthTdo Build()
{
if (K_seed == null) K_seed = new byte[0];
if (K_u == null) K_u = new byte[0];
if (K_a == null) K_a = new byte[0];
return lockInfoTdo;
}
}
}
}

View file

@ -0,0 +1,54 @@
using System;
namespace ShareeBike.Services.BluetoothLock.Tdo
{
/// <summary> Genuine ILOCKIT state.</summary>
public enum LockitLockingState
{
Open = 0x00,
Closed = 0x01,
Unknown = 0x02,
CouldntCloseMoving = 0x03,
CouldntOpenBoltBlocked = 0x04,
CouldntCloseBoltBlocked = 0x05
}
/// <summary> Object holding info about bluetooth lock. </summary>
public class LockInfoTdo
{
private LockInfoTdo() { }
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get; private set; }
/// <summary> Guid for direct connect.</summary>
public Guid Guid { get; private set; }
/// <summary> Gets the current state of the lock.</summary>
public LockitLockingState? State { get; private set; }
public class Builder
{
private LockInfoTdo lockInfoTdo = new LockInfoTdo();
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get => lockInfoTdo.Id; set => lockInfoTdo.Id = value; }
/// <summary> Guid for direct connect.</summary>
public Guid Guid { get => lockInfoTdo.Guid; set => lockInfoTdo.Guid = value; }
/// <summary> Gets the current state of the lock.</summary>
public LockitLockingState? State { get => lockInfoTdo.State; set => lockInfoTdo.State = value; }
public LockInfoTdo Build()
{
return lockInfoTdo;
}
}
}
}

View file

@ -0,0 +1,41 @@
namespace ShareeBike.Services.BluetoothLock.Tdo
{
public class VersionInfoTdo
{
/// <summary>
/// Holds info about firmware- and hardware version of a lock and the type of lock (lock version).
/// </summary>
private VersionInfoTdo() { }
/// <summary>
/// Holds the firmware version of the lock.
/// </summary>
public int FirmwareVersion { get; private set; }
/// <summary>
/// Holds the hardware version (revision) of the lock.
/// </summary>
public int HardwareVersion { get; private set; }
/// <summary>
/// Holds lock version (2 classic, 3 plus, 4 GPS).
/// </summary>
public int LockVersion { get; private set; }
public class Builder
{
private VersionInfoTdo lockVersionTdo = new VersionInfoTdo();
public int FirmwareVersion { get => lockVersionTdo.FirmwareVersion; set => lockVersionTdo.FirmwareVersion = value; }
public int HardwareVersion { get => lockVersionTdo.HardwareVersion; set => lockVersionTdo.HardwareVersion = value; }
public int LockVersion { get => lockVersionTdo.LockVersion; set => lockVersionTdo.LockVersion = value; }
public VersionInfoTdo Build()
{
return lockVersionTdo;
}
}
}
}