mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-23 05:16:29 +02:00
Version 3.0.337
This commit is contained in:
parent
fd0e63cf10
commit
573fe77e12
2336 changed files with 33688 additions and 86082 deletions
|
@ -1,4 +1,4 @@
|
|||
namespace TINK.Model.Bike.BluetoothLock
|
||||
namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||
{
|
||||
public interface ILockInfo
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
using TINK.Model.Connector;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using TINK.Model.Connector;
|
||||
|
||||
namespace TINK.Model.Bike.BluetoothLock
|
||||
namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
||||
{
|
||||
/// <summary> Locking states. </summary>
|
||||
public enum LockingState
|
||||
|
@ -53,7 +53,7 @@ namespace TINK.Model.Bike.BluetoothLock
|
|||
|
||||
public bool IsGuidValid => Guid != TextToLockItTypeHelper.INVALIDLOCKGUID;
|
||||
|
||||
public override bool Equals(object obj) => this.Equals(obj as LockInfo);
|
||||
public override bool Equals(object obj) => this.Equals(obj as LockInfo);
|
||||
|
||||
public bool Equals(LockInfo other)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ namespace TINK.Model.Bike.BluetoothLock
|
|||
|
||||
public static bool operator ==(LockInfo lhs, LockInfo rhs)
|
||||
{
|
||||
if (Object.ReferenceEquals(lhs, null))
|
||||
if (Object.ReferenceEquals(lhs, null))
|
||||
return Object.ReferenceEquals(rhs, null) ? true /*null == null = true*/: false;
|
||||
|
||||
return lhs.Equals(rhs);
|
||||
|
@ -101,25 +101,25 @@ namespace TINK.Model.Bike.BluetoothLock
|
|||
|
||||
private readonly LockInfo LockInfo = new LockInfo();
|
||||
|
||||
public byte[] UserKey { get => LockInfo.UserKey; set => LockInfo.UserKey = value; }
|
||||
|
||||
public byte[] UserKey { get => LockInfo.UserKey; set => LockInfo.UserKey = value; }
|
||||
|
||||
public byte[] AdminKey { get => LockInfo.AdminKey; set => LockInfo.AdminKey = value; }
|
||||
|
||||
|
||||
public byte[] Seed { get => LockInfo.Seed; set => LockInfo.Seed = value; }
|
||||
|
||||
public int Id { get => LockInfo.Id; set => LockInfo.Id = value; }
|
||||
|
||||
public Guid Guid { get => LockInfo.Guid; set => LockInfo.Guid = value; }
|
||||
|
||||
public LockingState State { get => LockInfo.State; set => LockInfo.State = value; }
|
||||
public LockingState State { get => LockInfo.State; set => LockInfo.State = value; }
|
||||
|
||||
public LockInfo Build()
|
||||
{
|
||||
// Ensure consistency.
|
||||
if ((UserKey?.Length > 0 || Seed?.Length > 0)
|
||||
if ((UserKey?.Length > 0 || Seed?.Length > 0)
|
||||
&& (UserKey?.Length == 0 || Seed?.Length == 0 || !LockInfo.IsIdValid))
|
||||
throw new ArgumentException($"Can not build {typeof(LockInfo).Name}. Lock parameters must either be all know or all unknown.");
|
||||
|
||||
throw new ArgumentException($"Can not build {typeof(LockInfo).Name}. Lock parameters must either be all know or all unknown.");
|
||||
|
||||
if (UserKey == null) UserKey = new byte[0];
|
||||
if (AdminKey == null) AdminKey = new byte[0];
|
||||
if (Seed == null) Seed = new byte[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue