private static void OnLogRecord(Message message)
 {
     hub.Clients.Group(LogRecordSource.GatewayDecodedMessages.ToString())
         .OnLogRecord(new LogRecord(
             LogRecordSource.GatewayDecodedMessages, 
             LogRecordType.Info, 
             message.ToString()));
 }
 private static void OnMessageRecieved(Message message)
 {
     hub.Clients.All.OnMessageRecieved(message.ToString());
 }
Exemple #3
0
        public void AddGatewayDecodedMessage(Message message)
        {
            LogRecord logRecord = new LogRecord(LogRecordSource.GatewayDecodedMessages, LogRecordType.Info, message.ToString());

            if (consoleConfig.ShowGatewayDecodedMessages)
                Show(logRecord);

            OnGatewayDecodedMessageLog?.Invoke(message);

            if (config.StoreGatewayDecodedMessages)
            {
                lock (gatewayDecodedMessagesLogLock)
                {
                    gatewayDecodedMessagesLog.Add(message);
                    if (gatewayDecodedMessagesLog.Count > config.MaxGatewayDecodedMessages)
                        gatewayDecodedMessagesLog.RemoveAt(0);
                }
            }
        }