#include "StatusPlugin.h" #include "IGsmModem.h" #include "Sms.h" #include #include "version.h" #include "common.h" StatusPlugin::StatusPlugin() : Plugin("status", "Returns a status of the smsdaemon") { } void StatusPlugin::Execute(IGsmModem& modem, SMS& sms) { Common* cmn = Common::instance(); int sec = time(0) - cmn->daemonStart; int min = sec / 60; int hour = min / 60; std::ostringstream os; os << VERSION << std::endl; os << SVNVERSION << std::endl; os << "Status:" << std::endl; os << "Recv: " << cmn->smsCounter.incomming << std::endl; os << "Send: " << cmn->smsCounter.outgoing << std::endl; os << "Uptime: " << hour << ":" << min << ":" << sec; modem.SendSms(sms.sender, os.str(), true ); }