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