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

Diff of /smsdaemon/ModemTransceiver.cpp

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

revision 158 by torben, Mon Dec 8 21:49:49 2008 UTC revision 171 by torben, Wed Dec 10 08:59:58 2008 UTC
# Line 15  Line 15 
15  #include "Util.h"  #include "Util.h"
16  #include "Common.h"  #include "Common.h"
17  #include "Logger.h"  #include "Logger.h"
18    #include "ConfigFile.h"
19    
20  #include "SmsPdu.h"  #include "SmsPdu.h"
21  #include "SmsHelper.h"  #include "SmsHelper.h"
# Line 202  void ModemTransceiver::WaitForSimcard() Line 203  void ModemTransceiver::WaitForSimcard()
203    
204  void ModemTransceiver::HandlePincode()  void ModemTransceiver::HandlePincode()
205  {  {
206            string pin = Common::instance()->GetConfigfile()->GetValue("gsmmodem","pin");
207    
208          string result = Command("AT+CPIN?");          string result = Command("AT+CPIN?");
209          result = Util::str_trim(result);          result = Util::str_trim(result);
210          result.erase(result.length() -2, 2); //remove trailing ok          result.erase(result.length() -2, 2); //remove trailing ok
# Line 211  void ModemTransceiver::HandlePincode() Line 214  void ModemTransceiver::HandlePincode()
214                  if (result == "+CPIN: SIM PIN")                  if (result == "+CPIN: SIM PIN")
215                  {                  {
216                          Command("AT^SSET=1");                          Command("AT^SSET=1");
217                          result = Command("AT+CPIN=0067");                          result = Command( string("AT+CPIN=")+pin  );
218                          if ( result.substr(result.length()-4, 4) != "OK\r\n")                          if ( result.substr(result.length()-4, 4) != "OK\r\n")
219                                  throw std::runtime_error(string("Illegal pincode: ") + result);                                  throw std::runtime_error(string("Illegal pincode: ") + result);
220                                                    

Legend:
Removed from v.158  
changed lines
  Added in v.171

  ViewVC Help
Powered by ViewVC 1.1.20