32 |
|
|
33 |
void SmsDaemon::CheckSms() |
void SmsDaemon::CheckSms() |
34 |
{ |
{ |
35 |
const int INTERVAL = 250; //no of milliseconds between sms checks |
const int INTERVAL = 1000; //no of milliseconds between sms checks |
36 |
timeval now = Util::GetTimeOfDay(); |
timeval now = Util::GetTimeOfDay(); |
37 |
|
|
38 |
if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) |
if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) |
78 |
|
|
79 |
mainContinue = true; |
mainContinue = true; |
80 |
|
|
|
int loopcount = 0; |
|
81 |
while (mainContinue) |
while (mainContinue) |
82 |
{ |
{ |
|
if (loopcount > 100 ) |
|
|
{ |
|
|
CheckSms(); |
|
83 |
|
|
84 |
cmn->GetTaskManager()->ExecuteTasks(_modem); |
CheckSms(); |
85 |
|
|
86 |
loopcount = 0; |
cmn->GetTaskManager()->ExecuteTasks(_modem); |
|
} |
|
87 |
|
|
88 |
if (cmn->isDebug && kbhit()) |
if (cmn->isDebug && kbhit()) |
89 |
break; |
break; |
90 |
|
|
91 |
loopcount++; |
Util::Sleep(100); |
|
Util::Sleep(10); |
|
92 |
|
|
93 |
} |
} |
94 |
} |
} |