sharee.bike-App/LockIt.BusinessLogic/Services/BluetoothLock/Tdo/LockInfoTdo.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2021-05-13 17:07:16 +02:00
using System;
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Services.BluetoothLock.Tdo
2021-05-13 17:07:16 +02:00
{
2022-09-06 16:08:19 +02:00
/// <summary> Genuine ILOCKIT state.</summary>
public enum LockitLockingState
{
Open = 0x00,
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
Closed = 0x01,
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
Unknown = 0x02,
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
CouldntCloseMoving = 0x03,
2022-08-30 15:42:25 +02:00
2023-08-31 12:20:06 +02:00
CouldntOpenBoltBlocked = 0x04,
2022-08-30 15:42:25 +02:00
2023-08-31 12:20:06 +02:00
CouldntCloseBoltBlocked = 0x05
2022-09-06 16:08:19 +02:00
}
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Object holding info about bluetooth lock. </summary>
public class LockInfoTdo
{
private LockInfoTdo() { }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get; private set; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Guid for direct connect.</summary>
public Guid Guid { get; private set; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Gets the current state of the lock.</summary>
public LockitLockingState? State { get; private set; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
public class Builder
{
private LockInfoTdo lockInfoTdo = new LockInfoTdo();
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Identification number of bluetooth lock, 6-digits, second part of advertisement name.</summary>
public int Id { get => lockInfoTdo.Id; set => lockInfoTdo.Id = value; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Guid for direct connect.</summary>
public Guid Guid { get => lockInfoTdo.Guid; set => lockInfoTdo.Guid = value; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Gets the current state of the lock.</summary>
public LockitLockingState? State { get => lockInfoTdo.State; set => lockInfoTdo.State = value; }
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
public LockInfoTdo Build()
{
return lockInfoTdo;
}
}
}
2021-05-13 17:07:16 +02:00
}