-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only state persistance is implemented for now. (Which is missing in e.g. the lighting service)
- Loading branch information
Showing
9 changed files
with
449 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Exo.Service; | ||
|
||
public enum SensorDataType : byte | ||
{ | ||
UInt8, | ||
UInt16, | ||
UInt32, | ||
UInt64, | ||
UInt128, | ||
SInt8, | ||
SInt16, | ||
SInt32, | ||
SInt64, | ||
SInt128, | ||
Float16, | ||
Float32, | ||
Float64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Immutable; | ||
|
||
namespace Exo.Service; | ||
|
||
public readonly struct SensorDeviceInformation : IEquatable<SensorDeviceInformation> | ||
{ | ||
public SensorDeviceInformation(Guid deviceId, ImmutableArray<SensorInformation> sensors) | ||
{ | ||
DeviceId = deviceId; | ||
Sensors = sensors; | ||
} | ||
|
||
public Guid DeviceId { get; } | ||
public ImmutableArray<SensorInformation> Sensors { get; } | ||
|
||
public override bool Equals(object? obj) => obj is SensorDeviceInformation information && Equals(information); | ||
public bool Equals(SensorDeviceInformation other) => DeviceId.Equals(other.DeviceId) && Sensors.SequenceEqual(other.Sensors); | ||
public override int GetHashCode() => HashCode.Combine(DeviceId, Sensors.Length); | ||
|
||
public static bool operator ==(SensorDeviceInformation left, SensorDeviceInformation right) => left.Equals(right); | ||
public static bool operator !=(SensorDeviceInformation left, SensorDeviceInformation right) => !(left == right); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Exo.Service; | ||
|
||
public record struct SensorInformation | ||
{ | ||
public SensorInformation(Guid sensorId, SensorDataType dataType, bool isPolled) | ||
{ | ||
SensorId = sensorId; | ||
DataType = dataType; | ||
IsPolled = isPolled; | ||
} | ||
|
||
public Guid SensorId { get; } | ||
public SensorDataType DataType { get; } | ||
public bool IsPolled { get; } | ||
} |
Oops, something went wrong.