--- smsdaemon/GsmModem.cpp 2008/06/12 15:23:11 67 +++ smsdaemon/GsmModem.cpp 2008/06/16 11:39:33 93 @@ -2,11 +2,9 @@ */ #include - #include #include -#include #include @@ -74,6 +72,7 @@ if ( (now-start) > 10 ) { Common::instance()->logMessage( string("GsmModem::Command time out --") + command); + Common::instance()->logMessage( string("Modem responded: ") + Util::str_trim(response) ); _timeout = true; break; } @@ -81,8 +80,6 @@ Util::Sleep(5); -// cout << response.length() << ":" << response << endl; -// DumpString(response); return response; } @@ -90,12 +87,12 @@ vector GsmModem::ReadSms(bool readAll) { - Command( "AT+CMGF=1" ); //Set SMS format to text + Command( "AT+CMGF=0" ); //Set SMS format to PDU const string search = "+CMGL: "; std::string cmd = "AT+CMGL"; if (readAll) - cmd.append("=ALL"); + cmd.append("=4"); string result = Command(cmd); @@ -112,7 +109,7 @@ string sms_entry = result.substr(0,endpos); - retval.push_back( SMS::FromRawString(sms_entry) );; + retval.push_back( SMS::FromPduString(sms_entry) );; if (endpos == string::npos) break; @@ -196,6 +193,10 @@ Command ("AT^SM20=0,0" ); //No SM20 compability + //Command("AT+CGATT=1"); //GPRS Attach + + //Command("AT+CGSMS=2"); //SMS over GPRS preferred + //Set RealTimeClock ?? //Enter pin code ??