/[projects]/smsdaemon/main.cpp
ViewVC logotype

Diff of /smsdaemon/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 36 by torben, Tue Jun 10 15:34:19 2008 UTC revision 75 by torben, Fri Jun 13 10:10:06 2008 UTC
# Line 1  Line 1 
 #include <iostream>  
1  #include <string>  #include <string>
2    
3  #include <cctype>  #include <cctype>
# Line 58  void main_loop(GsmModem& modem) Line 57  void main_loop(GsmModem& modem)
57                          }                          }
58                          else                          else
59                          {                          {
60                                  modem.SendSms(sms[i].sender, "Unknown command!");                                  modem.SendSms(sms[i].sender, "Unknown command!", false);
61                          }                          }
62    
63                          modem.DeleteSms(sms[i].sms_index);                          modem.DeleteSms(sms[i].sms_index);
# Line 74  void main_loop(GsmModem& modem) Line 73  void main_loop(GsmModem& modem)
73          }          }
74  }  }
75    
76    bool sms_exit(int exitcode)
77    {
78        if (Common::instance()->isDaemon)
79            daemonCleanup();
80    
81            exit(exitcode);
82    }
83    
84  int main(int argc, char* argv[])  int main(int argc, char* argv[])
85  {  {
# Line 115  int main(int argc, char* argv[]) Line 121  int main(int argc, char* argv[])
121          catch(std::exception &e)          catch(std::exception &e)
122          {          {
123                  cmn->logMessage( string("PortOpen Exception: ") + e.what() );                  cmn->logMessage( string("PortOpen Exception: ") + e.what() );
124                  exit(1);                  sms_exit(1);
125          }          }
126    
127          GsmModem modem(port);          GsmModem modem(port);
128    
129            try
130            {
131                    modem.Init();
132            }
133            catch (std::exception& e)
134            {
135                    cmn->logMessage( string("GsmModem Exception: ") + e.what() );
136                    sms_exit(2);
137            }
138    
139    
140          //////////////////////////////////          //////////////////////////////////
141    

Legend:
Removed from v.36  
changed lines
  Added in v.75

  ViewVC Help
Powered by ViewVC 1.1.20