--- smsdaemon/plugins/StatusPlugin.cpp 2008/06/16 16:41:18 101 +++ smsdaemon/plugins/StatusPlugin.cpp 2008/12/18 06:53:29 196 @@ -1,26 +1,29 @@ #include "StatusPlugin.h" -#include "IGsmModem.h" +#include "ISmsTransceiver.h" #include "Sms.h" #include #include "version.h" -#include "common.h" +#include "Common.h" StatusPlugin::StatusPlugin() - : Plugin("status", "Returns a status of the smsdaemon") + : Plugin("status", "Returns a status of the smsdaemon") { } -void StatusPlugin::Execute(IGsmModem& modem, SMS& sms) +void StatusPlugin::Execute(ISmsTransceiver& modem, SMS& sms) { Common* cmn = Common::instance(); - int sec = time(0) - cmn->daemonStart; - int min = sec / 60; - int hour = min / 60; + int tot_sec = time(0) - cmn->daemonStart; + + int sec = tot_sec % 60; + int min = (tot_sec / 60) % 60; + int hour = (tot_sec / 3600) %24; + int days = tot_sec / (3600*24); std::ostringstream os; os << VERSION << std::endl; @@ -28,9 +31,9 @@ os << "Status:" << std::endl; os << "Recv: " << cmn->smsCounter.incomming << std::endl; os << "Send: " << cmn->smsCounter.outgoing << std::endl; - os << "Uptime: " << hour << ":" << min << ":" << sec; + os << "Uptime: " << days << "d, " << hour << ":" << min << ":" << sec; - modem.SendSms(sms.sender, os.str(), true ); + modem.SendSms(sms.GetSender(), os.str(), true ); }