Initial commit
This commit is contained in:
24
DataModels/BatteryControllerPacket.cs
Normal file
24
DataModels/BatteryControllerPacket.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace MoniteurBaie.DataModels;
|
||||
|
||||
public class BatteryControllerPacket
|
||||
{
|
||||
public BatteryControllerPacket(string serialData) : this(DateTime.Now, serialData) { }
|
||||
|
||||
[JsonConstructor]
|
||||
public BatteryControllerPacket(DateTime timestamp, string serialData)
|
||||
{
|
||||
Timestamp = timestamp;
|
||||
SerialData = serialData;
|
||||
}
|
||||
|
||||
public DateTime Timestamp { get; private set; }
|
||||
|
||||
public string SerialData { get; private set; }
|
||||
}
|
||||
|
||||
[JsonSerializable(typeof(BatteryControllerPacket))]
|
||||
public partial class BatteryControllerPacketContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user