示例#1
0
        private void ReceivedS7AlarmIndicationDatagram(Memory <byte> buffer)
        {
            var data = S7AlarmIndicationDatagram.TranslateFromMemory(buffer);

            if (data.UserData.Data == null)
            {
                _logger.LogWarning("No data from alarm update ack received for reference {0}", data.UserData.Header.ProtocolDataUnitReference);
            }

            foreach (var handler in _alarmIndicationHandler.Values)
            {
                handler.Event.Set(data);
            }
        }
示例#2
0
        private void ReceivedS7AlarmIndicationDatagram(Memory <byte> buffer)
        {
            var data = S7AlarmIndicationDatagram.TranslateFromMemory(buffer);

            if (data.UserData.Data == null)
            {
                _logger?.LogWarning("No data from alarm update ack received for reference {0}", data.UserData.Header.ProtocolDataUnitReference);
            }

            foreach (var subscription in _subscriptions.Values)
            {
                subscription.AddDatagram(data);
            }

            foreach (var handler in _alarmIndicationHandler.Where(x => !_subscriptions.ContainsKey(x.Key)).Select(x => x.Value))
            {
                handler.Event.Set(data);
            }
        }