--- smsdaemon/SmsDaemon.cpp 2008/06/16 12:21:30 95 +++ 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" @@ -19,11 +21,10 @@ using namespace std; - 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"; @@ -33,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) @@ -48,7 +49,7 @@ for (unsigned int i=0; ismsCounter.incomming++; } } @@ -89,7 +90,7 @@ if (cmn->isDebug && kbhit()) break; - Util::Sleep(10); + Util::Sleep(100); } } @@ -98,13 +99,14 @@ { Common* cmn = Common::instance(); + srand(time(0)); cmn->daemonStart = time(0); _lastSmsCheck = Util::GetTimeOfDay(); cmn->logMessage("--------------------------------"); cmn->logMessage( VERSION ); - cmn->logMessage( SVNVER ); + cmn->logMessage( SVNVERSION ); cmn->GetTaskManager()->LoadTasks(); cmn->GetPluginManager()->LoadPlugins();