1 |
torben |
520 |
#ifndef __DELAYSPAMTASK_H__ |
2 |
|
|
#define __DELAYSPAMTASK_H__ |
3 |
|
|
|
4 |
|
|
#include <string> |
5 |
|
|
#include "Task.h" |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
class DelaySpamTask : public Task |
9 |
|
|
{ |
10 |
|
|
public: |
11 |
|
|
DelaySpamTask(); |
12 |
|
|
|
13 |
|
|
virtual void ExecuteTask(ISmsTransceiver& modem); |
14 |
|
|
|
15 |
|
|
virtual ~DelaySpamTask() {} |
16 |
|
|
|
17 |
|
|
void SetDestination(std::string& destination) |
18 |
|
|
{ |
19 |
|
|
_destination = destination; |
20 |
|
|
} |
21 |
|
|
void SetNumber(int number) |
22 |
|
|
{ |
23 |
|
|
_number = number; |
24 |
|
|
} |
25 |
|
|
void SetInterval(int interval) |
26 |
|
|
{ |
27 |
|
|
_interval = (interval*60); //recalculate from minutes to seconds |
28 |
|
|
} |
29 |
|
|
void SetMessage(std::string& message) |
30 |
|
|
{ |
31 |
|
|
_message = message; |
32 |
|
|
} |
33 |
|
|
private: |
34 |
|
|
|
35 |
|
|
std::string _destination; |
36 |
|
|
int _number; |
37 |
|
|
int _interval; |
38 |
|
|
std::string _message; |
39 |
|
|
|
40 |
|
|
int _counter; |
41 |
|
|
int _lastsent; |
42 |
|
|
|
43 |
|
|
|
44 |
|
|
}; |
45 |
|
|
|
46 |
|
|
|
47 |
|
|
#endif // __DELAYSPAMTASK_H__ |