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

Annotation of /smsdaemon/ModemTransceiver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 63 - (hide annotations) (download)
Thu Jun 12 12:43:29 2008 UTC (15 years, 11 months ago) by torben
Original Path: smsdaemon/GsmModem.h
File MIME type: text/plain
File size: 1235 byte(s)
Make GsmModem use the pdu way.

Added allowMultipart parameter to IGsmModem::SendSms()



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 "Sms.h"
12    
13 torben 53 class SerialPort;
14 torben 44
15     class IGsmModem
16 torben 26 {
17     public:
18 torben 63 virtual void SendSms(std::string to, std::string message, bool allowMultipart) = 0;
19 torben 44 virtual ~IGsmModem() {}
20     };
21    
22     class GsmModem : public IGsmModem
23     {
24     public:
25 torben 26 GsmModem(SerialPort& serialport);
26     virtual ~GsmModem() {}
27    
28 torben 57 void Init();
29 torben 26
30 torben 63 virtual void SendSms(std::string to, std::string message, bool allowMultipart);
31 torben 59 void SendSmsPdu(std::string pdu, int len);
32    
33 torben 26 std::vector<SMS> ReadSms(bool readAll=false);
34     void DeleteSms(std::string smsIndex);
35     int DeleteAllSms();
36     private:
37     std::string GetResponse();
38     std::string Command(std::string command, std::string term = "OK\r\n");
39    
40 torben 57 bool _timeout;
41 torben 26 SerialPort& m_port;
42     };
43    
44 torben 44 class DebugGsmModem : public IGsmModem
45     {
46     public:
47 torben 63 virtual void SendSms(std::string to, std::string message, bool allowMultipart)
48     {_to=to; _message = message; _multipart = allowMultipart;}
49 torben 26
50 torben 44 std::string GetTo() {return _to;}
51     std::string GetMessage() {return _message;}
52 torben 63 bool GetMultipart() {return _multipart;}
53 torben 44 private:
54     std::string _to;
55     std::string _message;
56 torben 63 bool _multipart;
57 torben 44 };
58    
59 torben 26 #endif // __GSMMODEM_H__

  ViewVC Help
Powered by ViewVC 1.1.20