1 |
#include <string> |
#include <string> |
2 |
#include <stdlib.h> |
#include <stdlib.h> |
3 |
|
#include <iostream> |
4 |
|
|
5 |
#include "daemon.h" |
#include "daemon.h" |
6 |
#include "Common.h" |
#include "Common.h" |
33 |
Common* cmn = Common::instance(); |
Common* cmn = Common::instance(); |
34 |
ConfigFile* config = cmn->GetConfigfile(); |
ConfigFile* config = cmn->GetConfigfile(); |
35 |
|
|
36 |
port = new SerialPort ( config->GetValue("smsdaemon","serialport") ); |
port = new SerialPort ( config->GetValue("gsmmodem","serialport") ); |
37 |
try |
try |
38 |
{ |
{ |
39 |
port->Open( SerialPort::BAUD_9600, |
port->Open( SerialPort::BAUD_9600, |
85 |
|
|
86 |
bool res = config->Open( cmn->configFilePath ) ; |
bool res = config->Open( cmn->configFilePath ) ; |
87 |
if (!res) { |
if (!res) { |
88 |
Logger::logMessage(string("Could not open config file:") + cmn->configFilePath); |
cout << "Could not open config file:" << cmn->configFilePath << endl; |
89 |
return 1; |
return 1; |
90 |
} |
} |
91 |
|
|
92 |
|
Logger::initLog(); |
93 |
|
|
94 |
|
|
95 |
///////////////////// |
///////////////////// |