diff --git a/4-series/mobile-control-messengers/Messengers/IMatrixRoutingMessenger.cs b/4-series/mobile-control-messengers/Messengers/IMatrixRoutingMessenger.cs index 5c9963f..fd587bf 100644 --- a/4-series/mobile-control-messengers/Messengers/IMatrixRoutingMessenger.cs +++ b/4-series/mobile-control-messengers/Messengers/IMatrixRoutingMessenger.cs @@ -15,10 +15,10 @@ namespace PepperDash.Essentials.AppServer.Messengers /// /// Type that implments IRoutingInputSlot /// Type that implments IRoutingOutputSlot - public class IMatrixRoutingMessenger : MessengerBase + public class IMatrixRoutingMessenger : MessengerBase where TInput: IRoutingInputSlot where TOutput : IRoutingOutputSlot { - private IMatrixRouting matrixDevice; - public IMatrixRoutingMessenger(string key, string messagePath, IMatrixRouting device) : base(key, messagePath, device as Device) + private readonly IMatrixRouting matrixDevice; + public IMatrixRoutingMessenger(string key, string messagePath, IMatrixRouting device) : base(key, messagePath, device as Device) { matrixDevice = device; } @@ -33,7 +33,7 @@ protected override void RegisterActions() try { Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, this, "InputCount: {inputCount}, OutputCount: {outputCount}", matrixDevice.InputSlots.Count, matrixDevice.OutputSlots.Count); - PostStatusMessage(new MatrixStateMessage + PostStatusMessage(new MatrixStateMessage { Outputs = matrixDevice.OutputSlots, Inputs = matrixDevice.InputSlots, @@ -82,13 +82,13 @@ protected override void RegisterActions() } } - public class MatrixStateMessage : DeviceStateMessageBase + public class MatrixStateMessage : DeviceStateMessageBase where TInput:IRoutingInputSlot where TOutput:IRoutingOutputSlot { [JsonProperty("outputs")] - public Dictionary Outputs; + public Dictionary Outputs; [JsonProperty("inputs")] - public Dictionary Inputs; + public Dictionary Inputs; } public class MatrixRouteRequest