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

Diff of /smsdaemon/ModemTransceiver.cpp

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

revision 149 by torben, Sun Dec 7 20:58:41 2008 UTC revision 157 by torben, Mon Dec 8 21:28:40 2008 UTC
# Line 14  Line 14 
14    
15  #include "util.h"  #include "util.h"
16  #include "common.h"  #include "common.h"
17    #include "Logger.h"
18    
19  #include "SmsPdu.h"  #include "SmsPdu.h"
20  #include "SmsHelper.h"  #include "SmsHelper.h"
# Line 72  string ModemTransceiver::Command(string Line 73  string ModemTransceiver::Command(string
73          now = time(0);          now = time(0);
74          if ( (now-start) > 10 )          if ( (now-start) > 10 )
75          {          {
76                  Common::instance()->logMessage( string("ModemTransceiver::Command time out --") + command);                  Logger::logMessage( string("ModemTransceiver::Command time out --") + command);
77                          Common::instance()->logMessage( string("Modem responded: ") + Util::str_trim(response) );                          Logger::logMessage( string("Modem responded: ") + Util::str_trim(response) );
78                          _timeout = true;                          _timeout = true;
79              break;              break;
80          }          }
# Line 124  vector<SMS> ModemTransceiver::ReadSms(bo Line 125  vector<SMS> ModemTransceiver::ReadSms(bo
125    
126  void ModemTransceiver::SendSmsPdu(std::string pdu, int len) //pdu inclussive leading "00"  void ModemTransceiver::SendSmsPdu(std::string pdu, int len) //pdu inclussive leading "00"
127  {  {
128          Common::instance()->logMessage( string("SMS pdu send") );          Logger::logMessage( string("SMS pdu send") );
129    
130          Command("AT+CMGF=0");          Command("AT+CMGF=0");
131          Util::Sleep(2);          Util::Sleep(2);
# Line 144  void ModemTransceiver::SendSmsPdu(std::s Line 145  void ModemTransceiver::SendSmsPdu(std::s
145    
146  void ModemTransceiver::SendSms(string to, string message, bool allowMultipart)  void ModemTransceiver::SendSms(string to, string message, bool allowMultipart)
147  {  {
148          Common::instance()->logMessage( string("SMS send to ") + to);          Logger::logMessage( string("SMS send to ") + to);
149    
150          if (to.at(0) == '+')          if (to.at(0) == '+')
151                  to.erase(0,0);                  to.erase(0,0);
# Line 157  void ModemTransceiver::SendSms(string to Line 158  void ModemTransceiver::SendSms(string to
158    
159                  SendSmsPdu(pdu.pdu, pdu.len);                  SendSmsPdu(pdu.pdu, pdu.len);
160          }          }
161          Common::instance()->logMessage( "All PDU's send");          Logger::logMessage( "All PDU's send");
162    
163  }  }
164    

Legend:
Removed from v.149  
changed lines
  Added in v.157

  ViewVC Help
Powered by ViewVC 1.1.20