24 lines
620 B
C#
24 lines
620 B
C#
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
|
|
{
|
|
} |