/[projects]/smsdaemon/ModemTransceiver.h
ViewVC logotype

Contents of /smsdaemon/ModemTransceiver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 678 - (show annotations) (download)
Tue Apr 27 21:06:53 2010 UTC (14 years ago) by torben
File MIME type: text/plain
File size: 898 byte(s)
undo previous unintentional commit
1 #ifndef __MODEMTRANSCEIVER_H__
2 #define __MODEMTRANSCEIVER_H__
3
4
5
6 #include "ISmsTransceiver.h"
7
8 #include <string>
9 #include <vector>
10
11 #include "Sms.h"
12
13 class SerialPort;
14
15
16 class ModemTransceiver : public ISmsTransceiver
17 {
18 public:
19 ModemTransceiver(SerialPort& serialport);
20 virtual ~ModemTransceiver() {}
21
22 void Init();
23
24 virtual void SendSms(std::string to, std::string message, bool allowMultipart);
25 void SendSmsPdu(std::string pdu, int len);
26
27 virtual std::vector<SMS> ReadSms(bool readAll=false);
28
29 void DeleteSms(std::string smsIndex);
30 private:
31 std::string GetResponse();
32 std::string Command(std::string command, std::string term = "OK\r\n");
33
34 //decode an CMGF=1 text string
35 SMS FromRawString(const std::string& input);
36 SMS FromPduString(const std::string& input);
37
38 void HandlePincode();
39 void WaitForSimcard();
40
41 bool _timeout;
42 SerialPort& m_port;
43 };
44
45
46 #endif // __MODEMTRANSCEIVER_H__

  ViewVC Help
Powered by ViewVC 1.1.20