/[projects]/smsdaemon/plugins/StatusPlugin.cpp
ViewVC logotype

Diff of /smsdaemon/plugins/StatusPlugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 101 by torben, Mon Jun 16 16:41:18 2008 UTC revision 102 by torben, Tue Jun 17 06:29:19 2008 UTC
# Line 18  void StatusPlugin::Execute(IGsmModem& mo Line 18  void StatusPlugin::Execute(IGsmModem& mo
18          Common* cmn = Common::instance();          Common* cmn = Common::instance();
19    
20    
21          int sec = time(0) - cmn->daemonStart;          int tot_sec = time(0) - cmn->daemonStart;
22          int min = sec / 60;  
23          int hour = min / 60;          int sec = tot_sec % 60;
24            int min = (tot_sec / 60) % 60;
25            int hour = (tot_sec / 3600) %24;
26            int days = tot_sec / (3600*24);
27    
28          std::ostringstream os;          std::ostringstream os;
29          os << VERSION << std::endl;          os << VERSION << std::endl;
# Line 28  void StatusPlugin::Execute(IGsmModem& mo Line 31  void StatusPlugin::Execute(IGsmModem& mo
31          os << "Status:" << std::endl;          os << "Status:" << std::endl;
32          os << "Recv: " << cmn->smsCounter.incomming << std::endl;          os << "Recv: " << cmn->smsCounter.incomming << std::endl;
33          os << "Send: " << cmn->smsCounter.outgoing << std::endl;          os << "Send: " << cmn->smsCounter.outgoing << std::endl;
34          os << "Uptime: " << hour << ":" << min << ":" << sec;          os << "Uptime: " << days << "d, " << hour << ":" << min << ":" << sec;
35    
36    
37          modem.SendSms(sms.sender, os.str(), true );          modem.SendSms(sms.sender, os.str(), true );

Legend:
Removed from v.101  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.20