34 |
Common* cmn = Common::instance(); |
Common* cmn = Common::instance(); |
35 |
ConfigFile* config = cmn->GetConfigfile(); |
ConfigFile* config = cmn->GetConfigfile(); |
36 |
|
|
37 |
port = new SerialPort ( config->GetValue("gsmmodem","serialport") ); |
std::string portstr = config->GetValue("gsmmodem","serialport",""); |
38 |
|
if (portstr == "") |
39 |
|
{ |
40 |
|
Logger::logMessage("'serialport' not defined in config file"); |
41 |
|
sms_exit(2); |
42 |
|
} |
43 |
|
|
44 |
|
port = new SerialPort ( portstr ); |
45 |
try |
try |
46 |
{ |
{ |
47 |
port->Open( SerialPort::BAUD_9600, |
port->Open( SerialPort::BAUD_9600, |
102 |
|
|
103 |
|
|
104 |
///////////////////// |
///////////////////// |
105 |
string transconf = config->GetValue("smsdaemon", "transceiver"); |
string transconf = config->GetValue("smsdaemon", "transceiver", ""); |
106 |
|
|
107 |
|
if (transconf == "") |
108 |
if (transconf == "internal") |
{ |
109 |
|
Logger::logMessage("No transceiver defined in config file"); |
110 |
|
exit(1); |
111 |
|
} |
112 |
|
else if (transconf == "internal") |
113 |
{ |
{ |
114 |
openModemPort(); |
openModemPort(); |
115 |
closeModemPort(); |
closeModemPort(); |