3 |
#include <string> |
#include <string> |
4 |
|
|
5 |
#include <sstream> |
#include <sstream> |
6 |
|
#include <stdlib.h> |
7 |
|
|
8 |
#include "common.h" |
#include "common.h" |
9 |
|
|
10 |
#include "GsmModem.h" |
#include "GsmModem.h" |
34 |
|
|
35 |
void SmsDaemon::CheckSms() |
void SmsDaemon::CheckSms() |
36 |
{ |
{ |
37 |
const int INTERVAL = 250; //no of milliseconds between sms checks |
const int INTERVAL = 1000; //no of milliseconds between sms checks |
38 |
timeval now = Util::GetTimeOfDay(); |
timeval now = Util::GetTimeOfDay(); |
39 |
|
|
40 |
if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) |
if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) |
90 |
if (cmn->isDebug && kbhit()) |
if (cmn->isDebug && kbhit()) |
91 |
break; |
break; |
92 |
|
|
93 |
Util::Sleep(10); |
Util::Sleep(100); |
94 |
|
|
95 |
} |
} |
96 |
} |
} |
99 |
{ |
{ |
100 |
Common* cmn = Common::instance(); |
Common* cmn = Common::instance(); |
101 |
|
|
102 |
|
srand(time(0)); |
103 |
|
|
104 |
cmn->daemonStart = time(0); |
cmn->daemonStart = time(0); |
105 |
_lastSmsCheck = Util::GetTimeOfDay(); |
_lastSmsCheck = Util::GetTimeOfDay(); |
106 |
|
|
107 |
cmn->logMessage("--------------------------------"); |
cmn->logMessage("--------------------------------"); |
108 |
cmn->logMessage( VERSION ); |
cmn->logMessage( VERSION ); |
109 |
cmn->logMessage( "Svn: " SVNVER ); |
cmn->logMessage( SVNVERSION ); |
110 |
|
|
111 |
cmn->GetTaskManager()->LoadTasks(); |
cmn->GetTaskManager()->LoadTasks(); |
112 |
cmn->GetPluginManager()->LoadPlugins(); |
cmn->GetPluginManager()->LoadPlugins(); |