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> |
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); |
208 |
|
|
209 |
//Enter pin code ?? |
//Enter pin code ?? |
210 |
} |
} |
211 |
|
|
212 |
|
|