4 |
/* using http://sourceforge.net/projects/libserial/ |
/* using http://sourceforge.net/projects/libserial/ |
5 |
*/ |
*/ |
6 |
|
|
7 |
|
#include "IGsmModem.h" |
8 |
|
|
9 |
#include <string> |
#include <string> |
10 |
#include <vector> |
#include <vector> |
13 |
|
|
14 |
class SerialPort; |
class SerialPort; |
15 |
|
|
|
class IGsmModem |
|
|
{ |
|
|
public: |
|
|
virtual void SendSms(std::string to, std::string message) = 0; |
|
|
virtual ~IGsmModem() {} |
|
|
}; |
|
16 |
|
|
17 |
class GsmModem : public IGsmModem |
class GsmModem : public IGsmModem |
18 |
{ |
{ |
22 |
|
|
23 |
void Init(); |
void Init(); |
24 |
|
|
25 |
virtual void SendSms(std::string to, std::string message); |
virtual void SendSms(std::string to, std::string message, bool allowMultipart); |
26 |
void SendSmsPdu(std::string pdu, int len); |
void SendSmsPdu(std::string pdu, int len); |
27 |
|
|
28 |
std::vector<SMS> ReadSms(bool readAll=false); |
std::vector<SMS> ReadSms(bool readAll=false); |
39 |
class DebugGsmModem : public IGsmModem |
class DebugGsmModem : public IGsmModem |
40 |
{ |
{ |
41 |
public: |
public: |
42 |
virtual void SendSms(std::string to, std::string message) |
DebugGsmModem() : _print(false) {} |
43 |
{_to=to; _message = message;} |
DebugGsmModem(bool print) : _print(print) {} |
44 |
|
|
45 |
|
|
46 |
|
virtual void SendSms(std::string to, std::string message, bool allowMultipart); |
47 |
|
|
48 |
std::string GetTo() {return _to;} |
std::string GetTo() {return _to;} |
49 |
std::string GetMessage() {return _message;} |
std::string GetMessage() {return _message;} |
50 |
|
bool GetMultipart() {return _multipart;} |
51 |
private: |
private: |
52 |
std::string _to; |
std::string _to; |
53 |
std::string _message; |
std::string _message; |
54 |
|
bool _multipart; |
55 |
|
bool _print; |
56 |
}; |
}; |
57 |
|
|
58 |
#endif // __GSMMODEM_H__ |
#endif // __GSMMODEM_H__ |