74 |
} |
} |
75 |
} |
} |
76 |
|
|
77 |
|
bool sms_exit(int exitcode) |
78 |
|
{ |
79 |
|
if (Common::instance()->isDaemon) |
80 |
|
daemonCleanup(); |
81 |
|
|
82 |
|
exit(exitcode); |
83 |
|
} |
84 |
|
|
85 |
int main(int argc, char* argv[]) |
int main(int argc, char* argv[]) |
86 |
{ |
{ |
122 |
catch(std::exception &e) |
catch(std::exception &e) |
123 |
{ |
{ |
124 |
cmn->logMessage( string("PortOpen Exception: ") + e.what() ); |
cmn->logMessage( string("PortOpen Exception: ") + e.what() ); |
125 |
exit(1); |
sms_exit(1); |
126 |
} |
} |
127 |
|
|
128 |
GsmModem modem(port); |
GsmModem modem(port); |
129 |
|
|
130 |
|
try |
131 |
|
{ |
132 |
|
modem.Init(); |
133 |
|
} |
134 |
|
catch (std::exception& e) |
135 |
|
{ |
136 |
|
cmn->logMessage( string("GsmModem Exception: ") + e.what() ); |
137 |
|
sms_exit(2); |
138 |
|
} |
139 |
|
|
140 |
|
|
141 |
////////////////////////////////// |
////////////////////////////////// |
142 |
|
|