--- smsdaemon/GsmModem.h 2008/06/11 08:25:34 44 +++ smsdaemon/GsmModem.h 2008/06/12 12:43:29 63 @@ -8,14 +8,14 @@ #include #include -#include "SerialPort.h" #include "Sms.h" +class SerialPort; class IGsmModem { public: - virtual void SendSms(std::string to, std::string message) = 0; + virtual void SendSms(std::string to, std::string message, bool allowMultipart) = 0; virtual ~IGsmModem() {} }; @@ -25,31 +25,35 @@ GsmModem(SerialPort& serialport); virtual ~GsmModem() {} + void Init(); + + virtual void SendSms(std::string to, std::string message, bool allowMultipart); + void SendSmsPdu(std::string pdu, int len); - virtual void SendSms(std::string to, std::string message); std::vector ReadSms(bool readAll=false); void DeleteSms(std::string smsIndex); int DeleteAllSms(); private: - void Init(); std::string GetResponse(); std::string Command(std::string command, std::string term = "OK\r\n"); - + bool _timeout; SerialPort& m_port; }; class DebugGsmModem : public IGsmModem { public: - virtual void SendSms(std::string to, std::string message) - {_to=to; _message = message;} + virtual void SendSms(std::string to, std::string message, bool allowMultipart) + {_to=to; _message = message; _multipart = allowMultipart;} std::string GetTo() {return _to;} std::string GetMessage() {return _message;} + bool GetMultipart() {return _multipart;} private: std::string _to; std::string _message; + bool _multipart; }; #endif // __GSMMODEM_H__