Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 1 | #include "trigger_actions.hpp" |
| 2 | |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 3 | #include "messages/update_report_ind.hpp" |
Szymon Dompke | f670b02 | 2022-03-16 19:21:11 +0100 | [diff] [blame] | 4 | #include "types/trigger_types.hpp" |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 5 | #include "utils/clock.hpp" |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 6 | #include "utils/messanger.hpp" |
Krzysztof Grobelny | cff70c1 | 2022-10-27 07:16:08 +0000 | [diff] [blame] | 7 | #include "utils/to_short_enum.hpp" |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 8 | |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 9 | #include <phosphor-logging/log.hpp> |
| 10 | |
| 11 | #include <ctime> |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 12 | #include <iomanip> |
| 13 | #include <sstream> |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 14 | |
| 15 | namespace action |
| 16 | { |
| 17 | |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 18 | namespace |
| 19 | { |
Krzysztof Grobelny | 51f0fd5 | 2021-12-28 16:32:08 +0100 | [diff] [blame] | 20 | std::string timestampToString(Milliseconds timestamp) |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 21 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 22 | std::time_t t = static_cast<time_t>( |
| 23 | std::chrono::duration_cast<std::chrono::seconds>(timestamp).count()); |
| 24 | std::stringstream ss; |
| 25 | ss << std::put_time(std::gmtime(&t), "%FT%T.") << std::setw(3) |
| 26 | << std::setfill('0') << timestamp.count() % 1000 << 'Z'; |
| 27 | return ss.str(); |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 28 | } |
| 29 | } // namespace |
| 30 | |
| 31 | namespace numeric |
| 32 | { |
| 33 | |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 34 | static const char* getDirection(double value, double threshold) |
| 35 | { |
| 36 | if (value < threshold) |
| 37 | { |
| 38 | return "decreasing"; |
| 39 | } |
| 40 | if (value > threshold) |
| 41 | { |
| 42 | return "increasing"; |
| 43 | } |
| 44 | throw std::runtime_error("Invalid value"); |
| 45 | } |
| 46 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 47 | void LogToJournal::commit( |
| 48 | const std::string& triggerId, const ThresholdName thresholdNameInIn, |
| 49 | const std::string& sensorName, const Milliseconds timestamp, |
| 50 | const TriggerValue triggerValue) |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 51 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 52 | double value = std::get<double>(triggerValue); |
| 53 | std::string thresholdName = ::numeric::typeToString(type); |
| 54 | auto direction = getDirection(value, threshold); |
| 55 | |
Krzysztof Grobelny | cff70c1 | 2022-10-27 07:16:08 +0000 | [diff] [blame] | 56 | std::string msg = |
| 57 | "Numeric threshold '" + std::string(utils::toShortEnum(thresholdName)) + |
| 58 | "' of trigger '" + triggerId + "' is crossed on sensor " + sensorName + |
| 59 | ", recorded value: " + std::to_string(value) + |
| 60 | ", crossing direction: " + std::string(utils::toShortEnum(direction)) + |
| 61 | ", timestamp: " + timestampToString(timestamp); |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 62 | |
| 63 | phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); |
| 64 | } |
| 65 | |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 66 | const char* LogToRedfishEventLog::getRedfishMessageId(const double value) const |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 67 | { |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 68 | std::string direction(getDirection(value, threshold)); |
| 69 | |
| 70 | if (direction == "decreasing") |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 71 | { |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 72 | switch (type) |
| 73 | { |
| 74 | case ::numeric::Type::upperCritical: |
| 75 | return redfish_message_ids::TriggerNumericBelowUpperCritical; |
| 76 | case ::numeric::Type::lowerCritical: |
| 77 | return redfish_message_ids::TriggerNumericBelowLowerCritical; |
| 78 | case ::numeric::Type::upperWarning: |
| 79 | return redfish_message_ids::TriggerNumericReadingNormal; |
| 80 | case ::numeric::Type::lowerWarning: |
| 81 | return redfish_message_ids::TriggerNumericBelowLowerWarning; |
| 82 | } |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 83 | } |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 84 | |
| 85 | if (direction == "increasing") |
| 86 | { |
| 87 | switch (type) |
| 88 | { |
| 89 | case ::numeric::Type::upperCritical: |
| 90 | return redfish_message_ids::TriggerNumericAboveUpperCritical; |
| 91 | case ::numeric::Type::lowerCritical: |
| 92 | return redfish_message_ids::TriggerNumericAboveLowerCritical; |
| 93 | case ::numeric::Type::upperWarning: |
| 94 | return redfish_message_ids::TriggerNumericAboveUpperWarning; |
| 95 | case ::numeric::Type::lowerWarning: |
| 96 | return redfish_message_ids::TriggerNumericReadingNormal; |
| 97 | } |
| 98 | } |
| 99 | |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 100 | throw std::runtime_error("Invalid type"); |
| 101 | } |
| 102 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 103 | void LogToRedfishEventLog::commit( |
| 104 | const std::string& triggerId, const ThresholdName thresholdNameInIn, |
| 105 | const std::string& sensorName, const Milliseconds timestamp, |
| 106 | const TriggerValue triggerValue) |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 107 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 108 | double value = std::get<double>(triggerValue); |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 109 | auto messageId = getRedfishMessageId(value); |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 110 | |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 111 | if (messageId == redfish_message_ids::TriggerNumericReadingNormal) |
| 112 | { |
| 113 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 114 | "Logging numeric trigger action to Redfish Event Log.", |
| 115 | phosphor::logging::entry("REDFISH_MESSAGE_ID=%s", messageId), |
| 116 | phosphor::logging::entry("REDFISH_MESSAGE_ARGS=%s,%f,%s", |
| 117 | sensorName.c_str(), value, |
| 118 | triggerId.c_str())); |
| 119 | } |
| 120 | else |
| 121 | { |
| 122 | phosphor::logging::log<phosphor::logging::level::INFO>( |
| 123 | "Logging numeric trigger action to Redfish Event Log.", |
| 124 | phosphor::logging::entry("REDFISH_MESSAGE_ID=%s", messageId), |
| 125 | phosphor::logging::entry("REDFISH_MESSAGE_ARGS=%s,%f,%f,%s", |
| 126 | sensorName.c_str(), value, threshold, |
| 127 | triggerId.c_str())); |
| 128 | } |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 129 | } |
| 130 | |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 131 | void fillActions( |
| 132 | std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf, |
| 133 | const std::vector<TriggerAction>& ActionsEnum, ::numeric::Type type, |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 134 | double thresholdValue, boost::asio::io_context& ioc, |
Szymon Dompke | 94f71c5 | 2021-12-10 07:16:33 +0100 | [diff] [blame] | 135 | const std::shared_ptr<std::vector<std::string>>& reportIds) |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 136 | { |
| 137 | actionsIf.reserve(ActionsEnum.size()); |
| 138 | for (auto actionType : ActionsEnum) |
| 139 | { |
| 140 | switch (actionType) |
| 141 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 142 | case TriggerAction::LogToJournal: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 143 | { |
| 144 | actionsIf.emplace_back( |
| 145 | std::make_unique<LogToJournal>(type, thresholdValue)); |
| 146 | break; |
| 147 | } |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 148 | case TriggerAction::LogToRedfishEventLog: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 149 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 150 | actionsIf.emplace_back(std::make_unique<LogToRedfishEventLog>( |
| 151 | type, thresholdValue)); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 152 | break; |
| 153 | } |
| 154 | case TriggerAction::UpdateReport: |
| 155 | { |
| 156 | actionsIf.emplace_back( |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 157 | std::make_unique<UpdateReport>(ioc, reportIds)); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 158 | break; |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 164 | } // namespace numeric |
| 165 | |
| 166 | namespace discrete |
| 167 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 168 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 169 | void LogToJournal::commit( |
| 170 | const std::string& triggerId, const ThresholdName thresholdNameIn, |
| 171 | const std::string& sensorName, const Milliseconds timestamp, |
| 172 | const TriggerValue triggerValue) |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 173 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 174 | auto value = std::get<std::string>(triggerValue); |
| 175 | |
Krzysztof Grobelny | cff70c1 | 2022-10-27 07:16:08 +0000 | [diff] [blame] | 176 | std::string msg = |
| 177 | "Discrete condition '" + thresholdNameIn->get() + "' of trigger '" + |
| 178 | triggerId + "' is met on sensor " + sensorName + |
| 179 | ", recorded value: " + value + ", severity: " + |
| 180 | std::string(utils::toShortEnum(utils::enumToString(severity))) + |
| 181 | ", timestamp: " + timestampToString(timestamp); |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 182 | |
| 183 | phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); |
| 184 | } |
| 185 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 186 | void LogToRedfishEventLog::commit( |
| 187 | const std::string& triggerId, const ThresholdName thresholdNameIn, |
| 188 | const std::string& sensorName, const Milliseconds timestamp, |
| 189 | const TriggerValue triggerValue) |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 190 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 191 | auto value = std::get<std::string>(triggerValue); |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 192 | |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 193 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 194 | "Logging discrete trigger action to Redfish Event Log.", |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 195 | phosphor::logging::entry( |
| 196 | "REDFISH_MESSAGE_ID=%s", |
| 197 | redfish_message_ids::TriggerDiscreteConditionMet), |
| 198 | phosphor::logging::entry("REDFISH_MESSAGE_ARGS=%s,%s,%s", |
| 199 | sensorName.c_str(), value.c_str(), |
| 200 | triggerId.c_str())); |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 201 | } |
| 202 | |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 203 | void fillActions( |
| 204 | std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf, |
| 205 | const std::vector<TriggerAction>& ActionsEnum, |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 206 | ::discrete::Severity severity, boost::asio::io_context& ioc, |
Szymon Dompke | 94f71c5 | 2021-12-10 07:16:33 +0100 | [diff] [blame] | 207 | const std::shared_ptr<std::vector<std::string>>& reportIds) |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 208 | { |
| 209 | actionsIf.reserve(ActionsEnum.size()); |
| 210 | for (auto actionType : ActionsEnum) |
| 211 | { |
| 212 | switch (actionType) |
| 213 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 214 | case TriggerAction::LogToJournal: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 215 | { |
| 216 | actionsIf.emplace_back( |
| 217 | std::make_unique<LogToJournal>(severity)); |
| 218 | break; |
| 219 | } |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 220 | case TriggerAction::LogToRedfishEventLog: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 221 | { |
| 222 | actionsIf.emplace_back( |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 223 | std::make_unique<LogToRedfishEventLog>()); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 224 | break; |
| 225 | } |
| 226 | case TriggerAction::UpdateReport: |
| 227 | { |
| 228 | actionsIf.emplace_back( |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 229 | std::make_unique<UpdateReport>(ioc, reportIds)); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 230 | break; |
| 231 | } |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 236 | namespace onChange |
| 237 | { |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 238 | void LogToJournal::commit( |
| 239 | const std::string& triggerId, const ThresholdName thresholdNameIn, |
| 240 | const std::string& sensorName, const Milliseconds timestamp, |
| 241 | const TriggerValue triggerValue) |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 242 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 243 | auto value = triggerValueToString(triggerValue); |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 244 | std::string msg = |
| 245 | "Discrete condition 'OnChange' of trigger '" + triggerId + |
| 246 | "' is met on sensor: " + sensorName + ", recorded value: " + value + |
| 247 | ", timestamp: " + timestampToString(timestamp); |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 248 | |
| 249 | phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); |
| 250 | } |
| 251 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 252 | void LogToRedfishEventLog::commit( |
| 253 | const std::string& triggerId, const ThresholdName thresholdNameIn, |
| 254 | const std::string& sensorName, const Milliseconds timestamp, |
| 255 | const TriggerValue triggerValue) |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 256 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 257 | auto value = triggerValueToString(triggerValue); |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 258 | |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 259 | phosphor::logging::log<phosphor::logging::level::INFO>( |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 260 | "Logging onChange discrete trigger action to Redfish Event Log.", |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 261 | phosphor::logging::entry( |
| 262 | "REDFISH_MESSAGE_ID=%s", |
| 263 | redfish_message_ids::TriggerDiscreteConditionMet), |
| 264 | phosphor::logging::entry("REDFISH_MESSAGE_ARGS=%s,%s,%s", |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 265 | sensorName.c_str(), value.c_str(), |
Michal Orzel | 8018a3b | 2024-06-26 14:14:16 +0200 | [diff] [blame] | 266 | triggerId.c_str())); |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 267 | } |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 268 | |
| 269 | void fillActions( |
| 270 | std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf, |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 271 | const std::vector<TriggerAction>& ActionsEnum, boost::asio::io_context& ioc, |
Szymon Dompke | 94f71c5 | 2021-12-10 07:16:33 +0100 | [diff] [blame] | 272 | const std::shared_ptr<std::vector<std::string>>& reportIds) |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 273 | { |
| 274 | actionsIf.reserve(ActionsEnum.size()); |
| 275 | for (auto actionType : ActionsEnum) |
| 276 | { |
| 277 | switch (actionType) |
| 278 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 279 | case TriggerAction::LogToJournal: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 280 | { |
| 281 | actionsIf.emplace_back(std::make_unique<LogToJournal>()); |
| 282 | break; |
| 283 | } |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 284 | case TriggerAction::LogToRedfishEventLog: |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 285 | { |
Szymon Dompke | b7b7e1b | 2022-05-19 10:15:48 +0200 | [diff] [blame] | 286 | actionsIf.emplace_back( |
| 287 | std::make_unique<LogToRedfishEventLog>()); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 288 | break; |
| 289 | } |
| 290 | case TriggerAction::UpdateReport: |
| 291 | { |
| 292 | actionsIf.emplace_back( |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 293 | std::make_unique<UpdateReport>(ioc, reportIds)); |
Szymon Dompke | 2001301 | 2021-07-23 09:54:20 +0200 | [diff] [blame] | 294 | break; |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | } |
Szymon Dompke | f763c9e | 2021-03-12 09:19:22 +0100 | [diff] [blame] | 299 | } // namespace onChange |
| 300 | } // namespace discrete |
| 301 | |
Patrick Williams | 583ba44 | 2025-02-03 14:28:19 -0500 | [diff] [blame^] | 302 | void UpdateReport::commit( |
| 303 | const std::string& triggerId, const ThresholdName thresholdNameIn, |
| 304 | const std::string& sensorName, const Milliseconds timestamp, |
| 305 | const TriggerValue triggerValue) |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 306 | { |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 307 | if (reportIds->empty()) |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 308 | { |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 309 | return; |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 310 | } |
Krzysztof Grobelny | e6d4887 | 2022-02-08 13:41:30 +0100 | [diff] [blame] | 311 | |
| 312 | utils::Messanger messanger(ioc); |
| 313 | messanger.send(messages::UpdateReportInd{*reportIds}); |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 314 | } |
| 315 | } // namespace action |