8 |
#include <string> |
#include <string> |
9 |
#include <vector> |
#include <vector> |
10 |
|
|
|
#include "SerialPort.h" |
|
11 |
#include "Sms.h" |
#include "Sms.h" |
12 |
|
|
13 |
|
class SerialPort; |
14 |
|
|
15 |
class IGsmModem |
class IGsmModem |
16 |
{ |
{ |
25 |
GsmModem(SerialPort& serialport); |
GsmModem(SerialPort& serialport); |
26 |
virtual ~GsmModem() {} |
virtual ~GsmModem() {} |
27 |
|
|
28 |
|
void Init(); |
29 |
|
|
30 |
virtual void SendSms(std::string to, std::string message); |
virtual void SendSms(std::string to, std::string message); |
31 |
std::vector<SMS> ReadSms(bool readAll=false); |
std::vector<SMS> ReadSms(bool readAll=false); |
32 |
void DeleteSms(std::string smsIndex); |
void DeleteSms(std::string smsIndex); |
33 |
int DeleteAllSms(); |
int DeleteAllSms(); |
34 |
private: |
private: |
|
void Init(); |
|
35 |
std::string GetResponse(); |
std::string GetResponse(); |
36 |
std::string Command(std::string command, std::string term = "OK\r\n"); |
std::string Command(std::string command, std::string term = "OK\r\n"); |
37 |
|
|
38 |
|
bool _timeout; |
39 |
SerialPort& m_port; |
SerialPort& m_port; |
40 |
}; |
}; |
41 |
|
|