/[projects]/smsdaemon/SmsDaemon.cpp
ViewVC logotype

Diff of /smsdaemon/SmsDaemon.cpp

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

revision 94 by torben, Mon Jun 16 11:57:48 2008 UTC revision 125 by torben, Sat Dec 6 14:06:17 2008 UTC
# Line 19  Line 19 
19    
20  using namespace std;  using namespace std;
21    
   
22  void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin)  void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin)
23  {  {
24          ostringstream os;          ostringstream os;
# Line 33  void SmsDaemon::CreateLogMessage(SMS& sm Line 32  void SmsDaemon::CreateLogMessage(SMS& sm
32    
33  void SmsDaemon::CheckSms()  void SmsDaemon::CheckSms()
34  {  {
35            const int INTERVAL = 250; //no of milliseconds between sms checks
36            timeval now = Util::GetTimeOfDay();
37    
38            if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL)
39                    return;
40    
41            _lastSmsCheck = now;
42    
43          Common* cmn = Common::instance();          Common* cmn = Common::instance();
44    
45          PluginManager* manager = cmn->GetPluginManager();          PluginManager* manager = cmn->GetPluginManager();
# Line 71  void SmsDaemon::MainLoop() Line 78  void SmsDaemon::MainLoop()
78    
79          mainContinue = true;          mainContinue = true;
80    
81            int loopcount = 0;
82          while (mainContinue)          while (mainContinue)
83          {          {
84                    if (loopcount > 100 )
85                    {
86                            CheckSms();
87    
88                  CheckSms();                          cmn->GetTaskManager()->ExecuteTasks(_modem);
89    
90                  cmn->GetTaskManager()->ExecuteTasks(_modem);                          loopcount = 0;
91                    }
92    
93                  if (cmn->isDebug && kbhit())                  if (cmn->isDebug && kbhit())
94                          break;                          break;
# Line 92  void SmsDaemon::Start() Line 104  void SmsDaemon::Start()
104    
105    
106          cmn->daemonStart = time(0);          cmn->daemonStart = time(0);
107            _lastSmsCheck = Util::GetTimeOfDay();
108    
109          cmn->logMessage("--------------------------------");          cmn->logMessage("--------------------------------");
110          cmn->logMessage( VERSION );          cmn->logMessage( VERSION );
111          cmn->logMessage( SVNVER );          cmn->logMessage( SVNVERSION );
112    
113          cmn->GetTaskManager()->LoadTasks();          cmn->GetTaskManager()->LoadTasks();
114          cmn->GetPluginManager()->LoadPlugins();          cmn->GetPluginManager()->LoadPlugins();

Legend:
Removed from v.94  
changed lines
  Added in v.125

  ViewVC Help
Powered by ViewVC 1.1.20