--- smsdaemon/main.cpp 2008/12/21 22:08:20 211 +++ smsdaemon/main.cpp 2008/12/22 22:22:42 214 @@ -34,7 +34,14 @@ Common* cmn = Common::instance(); ConfigFile* config = cmn->GetConfigfile(); - port = new SerialPort ( config->GetValue("gsmmodem","serialport") ); + std::string portstr = config->GetValue("gsmmodem","serialport",""); + if (portstr == "") + { + Logger::logMessage("'serialport' not defined in config file"); + sms_exit(2); + } + + port = new SerialPort ( portstr ); try { port->Open( SerialPort::BAUD_9600, @@ -95,10 +102,14 @@ ///////////////////// - string transconf = config->GetValue("smsdaemon", "transceiver"); + string transconf = config->GetValue("smsdaemon", "transceiver", ""); - - if (transconf == "internal") + if (transconf == "") + { + Logger::logMessage("No transceiver defined in config file"); + exit(1); + } + else if (transconf == "internal") { openModemPort(); closeModemPort();