1 |
torben |
26 |
#ifndef __GSMMODEM_H__ |
2 |
|
|
#define __GSMMODEM_H__ |
3 |
|
|
|
4 |
|
|
/* using http://sourceforge.net/projects/libserial/ |
5 |
|
|
*/ |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
#include <string> |
9 |
|
|
#include <vector> |
10 |
|
|
|
11 |
|
|
#include "SerialPort.h" |
12 |
|
|
#include "Sms.h" |
13 |
|
|
|
14 |
|
|
class GsmModem |
15 |
|
|
{ |
16 |
|
|
public: |
17 |
|
|
GsmModem(SerialPort& serialport); |
18 |
|
|
virtual ~GsmModem() {} |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
void SendSms(std::string to, std::string message); |
22 |
|
|
std::vector<SMS> ReadSms(bool readAll=false); |
23 |
|
|
void DeleteSms(std::string smsIndex); |
24 |
|
|
int DeleteAllSms(); |
25 |
|
|
private: |
26 |
|
|
void Init(); |
27 |
|
|
std::string GetResponse(); |
28 |
|
|
std::string Command(std::string command, std::string term = "OK\r\n"); |
29 |
|
|
|
30 |
|
|
|
31 |
|
|
SerialPort& m_port; |
32 |
|
|
}; |
33 |
|
|
|
34 |
|
|
|
35 |
|
|
#endif // __GSMMODEM_H__ |