--- smsdaemon/SmsDaemon.cpp 2008/12/06 14:25:53 126 +++ smsdaemon/SmsDaemon.cpp 2008/12/07 20:58:41 149 @@ -3,9 +3,11 @@ #include #include +#include + #include "common.h" -#include "GsmModem.h" +#include "ISmsTransceiver.h" #include "Plugin.h" #include "kbhit.h" @@ -22,7 +24,7 @@ void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin) { ostringstream os; - os << "Recieved sms from " << sms.sender << " ; command=" << GetSmsCommand(sms); + os << "Recieved sms from " << sms.GetSender() << " ; command=" << sms.ExtractCommand(); if (!hasPlugin) os << " -- PLUGIN NOT FOUND"; @@ -32,7 +34,7 @@ void SmsDaemon::CheckSms() { - const int INTERVAL = 250; //no of milliseconds between sms checks + const int INTERVAL = 1000; //no of milliseconds between sms checks timeval now = Util::GetTimeOfDay(); if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) @@ -47,7 +49,7 @@ for (unsigned int i=0; ismsCounter.incomming++; } } @@ -78,23 +80,17 @@ mainContinue = true; - int loopcount = 0; while (mainContinue) { - if (loopcount > 100 ) - { - CheckSms(); - cmn->GetTaskManager()->ExecuteTasks(_modem); + CheckSms(); - loopcount = 0; - } + cmn->GetTaskManager()->ExecuteTasks(_modem); if (cmn->isDebug && kbhit()) break; - loopcount++; - Util::Sleep(10); + Util::Sleep(100); } } @@ -103,6 +99,7 @@ { Common* cmn = Common::instance(); + srand(time(0)); cmn->daemonStart = time(0); _lastSmsCheck = Util::GetTimeOfDay();