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

Diff of /smsdaemon/ModemTransceiver.cpp

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

revision 58 by torben, Wed Jun 11 16:14:28 2008 UTC revision 59 by torben, Wed Jun 11 19:42:24 2008 UTC
# Line 4  Line 4 
4  #include <iostream>  #include <iostream>
5    
6  #include <string>  #include <string>
 #include <cstring>  
7  #include <stdexcept>  #include <stdexcept>
8    
9  #include <sys/time.h>  #include <sys/time.h>
# Line 120  vector<SMS> GsmModem::ReadSms(bool readA Line 119  vector<SMS> GsmModem::ReadSms(bool readA
119          return retval;          return retval;
120  }  }
121    
122    
123    void GsmModem::SendSmsPdu(std::string pdu, int len) //pdu inclussive leading "00"
124    {
125            Common::instance()->logMessage( string("SMS pdu send") );
126    
127            Command("AT+CMGF=0");
128            Util::Sleep(2);
129    
130            string line1 = "AT+CMGS=";
131            line1.append( Util::str_formatint(len) );
132            line1.append("\r");
133    
134    
135            Command(line1,"> ");
136    
137            pdu.append("\032"); // \032 == Ctrl+Z
138            Command( pdu );
139            Util::Sleep( 50 );
140            Common::instance()->smsCounter.outgoing++;
141    }
142    
143  void GsmModem::SendSms(string to, string message)  void GsmModem::SendSms(string to, string message)
144  {  {
145          Common::instance()->logMessage( string("SMS send to ") + to);          Common::instance()->logMessage( string("SMS send to ") + to);
# Line 188  void GsmModem::Init() Line 208  void GsmModem::Init()
208                    
209          //Enter pin code ??          //Enter pin code ??
210  }  }
211    
212    

Legend:
Removed from v.58  
changed lines
  Added in v.59

  ViewVC Help
Powered by ViewVC 1.1.20