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

Diff of /smsdaemon/SmsDaemon.cpp

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

revision 88 by torben, Mon Jun 16 09:04:05 2008 UTC revision 94 by torben, Mon Jun 16 11:57:48 2008 UTC
# Line 12  Line 12 
12    
13  #include "util.h"  #include "util.h"
14    
15    #include "TaskManager.h"
16    #include "PluginManager.h"
17    
18    #include "version.h"
19    
20  using namespace std;  using namespace std;
21    
22    
# Line 30  void SmsDaemon::CheckSms() Line 35  void SmsDaemon::CheckSms()
35  {  {
36          Common* cmn = Common::instance();          Common* cmn = Common::instance();
37    
38          PluginManager& manager = cmn->pluginManager;          PluginManager* manager = cmn->GetPluginManager();
39          vector<SMS> sms = _modem.ReadSms();          vector<SMS> sms = _modem.ReadSms();
40    
41          for (unsigned int i=0; i<sms.size(); ++i)          for (unsigned int i=0; i<sms.size(); ++i)
# Line 39  void SmsDaemon::CheckSms() Line 44  void SmsDaemon::CheckSms()
44                                                    
45                  cmd = Util::str_tolower(cmd);                  cmd = Util::str_tolower(cmd);
46    
47                  Plugin* pl = manager.GetPlugin(cmd);                  Plugin* pl = manager->GetPlugin(cmd);
48    
49                  CreateLogMessage(sms[i], pl != 0);                  CreateLogMessage(sms[i], pl != 0);
50    
# Line 71  void SmsDaemon::MainLoop() Line 76  void SmsDaemon::MainLoop()
76    
77                  CheckSms();                  CheckSms();
78    
79                  cmn->taskManager.ExecuteTasks();                  cmn->GetTaskManager()->ExecuteTasks(_modem);
80    
81                  if (cmn->isDebug && kbhit())                  if (cmn->isDebug && kbhit())
82                          break;                          break;
# Line 89  void SmsDaemon::Start() Line 94  void SmsDaemon::Start()
94          cmn->daemonStart = time(0);          cmn->daemonStart = time(0);
95    
96          cmn->logMessage("--------------------------------");          cmn->logMessage("--------------------------------");
97            cmn->logMessage( VERSION );
98            cmn->logMessage( SVNVER );
99    
100          cmn->taskManager.LoadTasks();          cmn->GetTaskManager()->LoadTasks();
101          cmn->pluginManager.LoadPlugins();          cmn->GetPluginManager()->LoadPlugins();
102          cmn->logMessage("SMS daemon started");          cmn->logMessage("SMS daemon started");
103    
104          _modem.DeleteAllSms();          _modem.DeleteAllSms();

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

  ViewVC Help
Powered by ViewVC 1.1.20