mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 04:26: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
35
LockItBLE/Services/BluetoothLock/BLE/PluginBleHelper.cs
Normal file
35
LockItBLE/Services/BluetoothLock/BLE/PluginBleHelper.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
|
||||
namespace TINK.Services.BluetoothLock.BLE
|
||||
{
|
||||
public static class PluginBleHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps Plugin.BLE device state to LockItShared device state.
|
||||
/// </summary>
|
||||
/// <param name="state">State to convert</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException">Unexpected state detected.</exception>
|
||||
public static DeviceState GetDeviceState(this Plugin.BLE.Abstractions.DeviceState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case Plugin.BLE.Abstractions.DeviceState.Disconnected:
|
||||
return DeviceState.Disconnected;
|
||||
|
||||
case Plugin.BLE.Abstractions.DeviceState.Connecting:
|
||||
return DeviceState.Connecting;
|
||||
|
||||
case Plugin.BLE.Abstractions.DeviceState.Connected:
|
||||
return DeviceState.Connected;
|
||||
|
||||
case Plugin.BLE.Abstractions.DeviceState.Limited:
|
||||
return DeviceState.Limited;
|
||||
|
||||
default:
|
||||
throw new ArgumentException($"Can not convert state Plugin.BLE-{state}.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue