Ejemplo n.º 1
0
 public SerialConnection(ILogger logger, string portName, MessageHandler messageHandler)
 {
     _serialPort = new SerialPort
     {
         PortName = portName,
         BaudRate = 9600,
         Parity   = Parity.None,
         DataBits = 8,
         StopBits = StopBits.One,
         Encoding = Encoding.ASCII
     };
     _logger         = CategoryLogger.Create(nameof(SerialConnection), logger);
     _messageHandler = messageHandler;
 }
Ejemplo n.º 2
0
 public ActionRouter(ILogger logger, ButtonDeckCommunication communication)
 {
     _logger       = CategoryLogger.Create(nameof(ActionRouter), logger);
     Communication = communication;
     Communication.ToggleStateChanged   += Communication_ToggleStateChanged;
     Communication.VersionResponse      += Communication_VersionResponse;
     Communication.HeartbeatResponse    += Communication_HeartbeatResponse;
     Communication.LEDBrightness        += Communication_LEDBrightness;
     Communication.ButtonUp             += Communication_ButtonUp;
     Communication.ButtonDown           += Communication_ButtonDown;
     Communication.InvalidResponse      += Communication_InvalidResponse;
     Communication.AcknowledgedResponse += Communication_AcknowledgedResponse;
     Deck = ButtonDeckInformation.Default;
     Initialise();
 }
Ejemplo n.º 3
0
 public MessageBuilder(ILogger logger)
 {
     _logger = CategoryLogger.Create(nameof(MessageBuilder), logger);
 }