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

Diff of /smsdaemon/ModemTransceiver.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

smsdaemon/GsmModem.h revision 26 by torben, Mon Jun 9 18:15:53 2008 UTC smsdaemon/ModemTransceiver.h revision 180 by torben, Fri Dec 12 12:54:27 2008 UTC
# Line 1  Line 1 
1  #ifndef __GSMMODEM_H__  #ifndef __MODEMTRANSCEIVER_H__
2  #define __GSMMODEM_H__  #define __MODEMTRANSCEIVER_H__
3    
 /* using http://sourceforge.net/projects/libserial/  
  */  
4    
5    
6    #include "ISmsTransceiver.h"
7    
8  #include <string>  #include <string>
9  #include <vector>  #include <vector>
10    
 #include "SerialPort.h"  
11  #include "Sms.h"  #include "Sms.h"
12    
13  class GsmModem  class SerialPort;
14    
15    
16    class ModemTransceiver : public ISmsTransceiver
17  {  {
18  public:  public:
19          GsmModem(SerialPort& serialport);          ModemTransceiver(SerialPort& serialport);
20          virtual ~GsmModem() {}          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 SendSms(std::string to, std::string message);          virtual void DeleteSms(std::string smsIndex);
30          std::vector<SMS> ReadSms(bool readAll=false);          virtual int DeleteAllSms();
         void DeleteSms(std::string smsIndex);  
         int DeleteAllSms();  
31  private:  private:
         void Init();  
32          std::string GetResponse();          std::string GetResponse();
33          std::string Command(std::string command, std::string term = "OK\r\n");          std::string Command(std::string command, std::string term = "OK\r\n");
34    
35            //decode an CMGF=1 text string
36            SMS FromRawString(const std::string& input);
37            SMS FromPduString(const std::string& input);
38    
39            void HandlePincode();
40            void WaitForSimcard();
41    
42            bool _timeout;
43          SerialPort& m_port;          SerialPort& m_port;
44  };  };
45    
46    
47  #endif // __GSMMODEM_H__  #endif // __MODEMTRANSCEIVER_H__

Legend:
Removed from v.26  
changed lines
  Added in v.180

  ViewVC Help
Powered by ViewVC 1.1.20