5 |
#include "common.h" |
#include "common.h" |
6 |
|
|
7 |
#include "ModemTransceiver.h" |
#include "ModemTransceiver.h" |
8 |
|
#include "DebugTransceiver.h" |
9 |
|
#include "SmsToolTransceiver.h" |
10 |
|
|
11 |
#include "serialport/SerialPort.h" |
#include "serialport/SerialPort.h" |
12 |
#include "SmsDaemon.h" |
#include "SmsDaemon.h" |
13 |
#include "ConfigFile.h" |
#include "ConfigFile.h" |
89 |
|
|
90 |
|
|
91 |
///////////////////// |
///////////////////// |
92 |
|
string transconf = config->GetValue("smsdaemon", "transceiver"); |
93 |
|
|
94 |
|
|
95 |
openModemPort(); |
if (transconf == "internal") |
96 |
closeModemPort(); |
{ |
97 |
|
openModemPort(); |
98 |
|
closeModemPort(); |
99 |
|
} |
100 |
|
else if ( transconf == "debug" || transconf == "smstools") |
101 |
|
{ |
102 |
|
//do nothing |
103 |
|
} |
104 |
|
else |
105 |
|
{ |
106 |
|
cmn->logMessage( string("Invalid transceiver setting: ")+transconf); |
107 |
|
exit(1); |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
if (Common::instance()->isDaemon) |
if (Common::instance()->isDaemon) |
116 |
cmn->daemonized = true; |
cmn->daemonized = true; |
117 |
} |
} |
118 |
|
|
119 |
openModemPort(); |
|
120 |
|
if (transconf == "internal") |
121 |
|
{ |
122 |
|
openModemPort(); |
123 |
|
} |
124 |
|
else if (transconf =="smstools") |
125 |
|
{ |
126 |
|
transceiver = new SmsToolTransceiver(); |
127 |
|
} |
128 |
|
else if (transconf == "debug") |
129 |
|
{ |
130 |
|
transceiver = new DebugTransceiver(); |
131 |
|
} |
132 |
|
|
133 |
////////////////////////////////// |
////////////////////////////////// |
134 |
|
|
140 |
if (cmn->isDaemon) |
if (cmn->isDaemon) |
141 |
daemonCleanup(); |
daemonCleanup(); |
142 |
|
|
143 |
closeModemPort(); |
if (transconf == "builtin") |
144 |
|
{ |
145 |
|
closeModemPort(); |
146 |
|
} |
147 |
|
|
148 |
return 0; |
return 0; |
149 |
} |
} |