Skip to content

Commit 5500543

Browse files
committed
even more cleanup
1 parent 942dd38 commit 5500543

32 files changed

Lines changed: 75 additions & 62 deletions
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
namespace FTMS.NET.Control;
2-
public record ControlRequest(EControlOpCode OpCode, byte[] Parameter)
3-
{
4-
}
2+
3+
public sealed record ControlRequest(
4+
EControlOpCode OpCode,
5+
byte[] Parameter);
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
namespace FTMS.NET.Control;
2-
public record ControlResponse(EControlOpCode RequestedOpCode, EControlResultCode ResultCode, byte[] ResponseParameter)
3-
{
4-
}
2+
3+
public sealed record ControlResponse(
4+
EControlOpCode RequestedOpCode,
5+
EControlResultCode ResultCode,
6+
byte[] ResponseParameter);

FTMS.NET.Contracts/Control/IFitnessMachineControl.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
namespace FTMS.NET.Control;
2+
23
using System.Threading.Tasks;
34

45
public interface IFitnessMachineControl : IDisposable

FTMS.NET.Contracts/Data/IFitnessMachineValue.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
namespace FTMS.NET.Data;
2+
23
using System;
34

45
public interface IFitnessMachineValue

FTMS.NET.Contracts/Exceptions/ControlRequestException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using FTMS.NET.Control;
44
using System;
55

6-
public class ControlRequestException(EControlOpCode opCode, Exception? innerException = null)
6+
public sealed class ControlRequestException(
7+
EControlOpCode opCode,
8+
Exception? innerException = null)
79
: Exception("Control Request could not be executed.", innerException)
810
{
911
public EControlOpCode OpCode { get; } = opCode;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace FTMS.NET.Exceptions;
22
using System;
33

4-
public class FitnessMachineNotAvailableException()
5-
: Exception("The service data indicate, that the fitness machine service is not available.")
6-
{
7-
}
4+
public sealed class FitnessMachineNotAvailableException()
5+
: Exception("The service data indicate, that the fitness machine service is not available.");

FTMS.NET.Contracts/Exceptions/FitnessMachineTypeNotDefinedException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using System;
44

5-
public class FitnessMachineTypeNotDefinedException(EFitnessMachineType machineType)
5+
public sealed class FitnessMachineTypeNotDefinedException(EFitnessMachineType machineType)
66
: Exception("The fitness machine type sent from the server is not defined.")
77
{
88
public EFitnessMachineType MachineType { get; } = machineType;

FTMS.NET.Contracts/Exceptions/NeededCharacteristicNotAvailableException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System;
44

55
public sealed class NeededCharacteristicNotAvailableException(
6-
Guid characteristicUuid)
6+
Guid characteristicUuid)
77
: Exception("The needed characteristic is not available.")
88
{
99
public string CharacteristicName { get; } = FtmsUuids.GetName(characteristicUuid);

FTMS.NET.Contracts/Features/ISupportedRangeExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public static class ISupportedRangeExtensions
88
public static bool IsInRange<TValue>(this ISupportedRange range, TValue value)
99
where TValue : struct, INumber<TValue>
1010
=> GenericMath.IsInRange(value, range.MinimumValue, range.MaximumValue);
11+
1112
public static TValue Clamp<TValue>(this ISupportedRange range, TValue value)
1213
where TValue : struct, INumber<TValue>
1314
=> GenericMath.Clamp(value, range.MinimumValue, range.MaximumValue);

FTMS.NET.Contracts/IFitnessMachineCharacteristic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
namespace FTMS.NET;
2+
23
using System;
34
using System.Threading.Tasks;
45

56
public interface IFitnessMachineCharacteristic
67
{
78
public Guid Id { get; }
8-
99
Task<byte[]> ReadValueAsync();
1010
Task WriteValueAsync(byte[] value);
1111
IObservable<byte[]> ObserveValue();

0 commit comments

Comments
 (0)