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

Annotation of /smsdaemon/ModemTransceiver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (hide annotations) (download)
Wed Jun 11 08:25:34 2008 UTC (15 years, 11 months ago) by torben
Original Path: smsdaemon/GsmModem.h
File MIME type: text/plain
File size: 1028 byte(s)
Intermediate code sync.

TrainInfo.*
TogPlugin.*: plugin to get train departure info from bane.dk

SpamPlugin.*
ShellExecPlugin.*
EchoPlugin.*
Plugin.h
GsmModem.h: implemented IGsmModem in order to make offline Plugin testing easier.


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

  ViewVC Help
Powered by ViewVC 1.1.20