25 const std::string &cmd,
26 rad::ThreadActivity* activity) {
30 auto repl_ok = config.
GetReplyOk(cmd).value_or(
true);
33 LOG4CPLUS_INFO(ifw::core::utils::bat::GetAppLogger(),
"Reply msg: " << msg);
35 LOG4CPLUS_DEBUG(ifw::core::utils::bat::GetAppLogger(),
"Reply delay: " << delay);
37 int increment = int(delay/100);
38 LOG4CPLUS_DEBUG(ifw::core::utils::bat::GetAppLogger(),
"Increment: " << increment);
39 while (total < delay) {
40 if (activity->IsStopRequested()) {
41 sm.PostEvent(rad::UniqueEvent(
new EVENT_ERR(cmd +
" has been stopped !" )));
44 std::this_thread::sleep_for(std::chrono::milliseconds(increment));
46 LOG4CPLUS_DEBUG(ifw::core::utils::bat::GetAppLogger(),
"Total Time: " << total <<
" [ms]");
50 sm.PostEvent(rad::UniqueEvent(
new EVENT_DONE));
52 sm.PostEvent(rad::UniqueEvent(
new EVENT_ERR(msg )));