--- smsdaemon/ModemTransceiver.cpp 2008/12/08 21:49:49 158 +++ smsdaemon/ModemTransceiver.cpp 2008/12/10 08:59:58 171 @@ -15,6 +15,7 @@ #include "Util.h" #include "Common.h" #include "Logger.h" +#include "ConfigFile.h" #include "SmsPdu.h" #include "SmsHelper.h" @@ -202,6 +203,8 @@ void ModemTransceiver::HandlePincode() { + string pin = Common::instance()->GetConfigfile()->GetValue("gsmmodem","pin"); + string result = Command("AT+CPIN?"); result = Util::str_trim(result); result.erase(result.length() -2, 2); //remove trailing ok @@ -211,7 +214,7 @@ if (result == "+CPIN: SIM PIN") { Command("AT^SSET=1"); - result = Command("AT+CPIN=0067"); + result = Command( string("AT+CPIN=")+pin ); if ( result.substr(result.length()-4, 4) != "OK\r\n") throw std::runtime_error(string("Illegal pincode: ") + result);