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

Diff of /smsdaemon/tester.cpp

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

revision 142 by torben, Sun Dec 7 15:51:02 2008 UTC revision 158 by torben, Mon Dec 8 21:49:49 2008 UTC
# Line 8  Line 8 
8  #include <vector>  #include <vector>
9  #include "serialport/SerialPort.h"  #include "serialport/SerialPort.h"
10    
11  #include "GsmModem.h"  #include "DebugTransceiver.h"
12    #include "SmsToolTransceiver.h"
13  #include "Sms.h"  #include "Sms.h"
14  #include "plugins/TogPlugin.h"  #include "plugins/TogPlugin.h"
15  #include "plugins/TrainInfo.h"  #include "plugins/TrainInfo.h"
16  #include "util.h"  #include "Util.h"
17  #include "plugins/StatusPlugin.h"  #include "plugins/StatusPlugin.h"
18  #include "SmsPdu.h"  #include "SmsPdu.h"
19    
20  using namespace std;  using namespace std;
21  using namespace Util;  using namespace Util;
22    
23  void test_sms(GsmModem& modem, int len)  void test_sms(ISmsTransceiver& modem, int len)
24  {  {
25          cout << "----- test_sms( " << len << " ) ------- " << endl;          cout << "----- test_sms( " << len << " ) ------- " << endl;
26    
# Line 35  void test_sms(GsmModem& modem, int len) Line 36  void test_sms(GsmModem& modem, int len)
36                  cout << "Len: " << pdu[i].len << endl;                  cout << "Len: " << pdu[i].len << endl;
37                  cout << "Pdu: " << pdu[i].pdu << endl;                  cout << "Pdu: " << pdu[i].pdu << endl;
38    
39                  modem.SendSmsPdu(pdu[i].pdu, pdu[i].len);  //              modem.SendSmsPdu(pdu[i].pdu, pdu[i].len);
40          }          }
41  }  }
42    
# Line 51  int main() Line 52  int main()
52          cout << end << endl;          cout << end << endl;
53          return 0;          return 0;
54  */  */
55          string start = "hej æøåÆØÅ";  
56            SmsToolTransceiver trans;
57    
58            trans.ReadSms();
59    
60            return 0;
61            string start = "hej ������";
62          string mid = str_latin2gsm(start);          string mid = str_latin2gsm(start);
63          string final = str_gsm2latin(mid);          string final = str_gsm2latin(mid);
64    
# Line 62  int main() Line 69  int main()
69    
70          return 0;          return 0;
71    
72          DebugGsmModem modem(true);          DebugTransceiver modem(true);
73          SMS sms;          SMS sms;
74          sms.SetSender("1234");          sms.SetSender("1234");
75          sms.SetMessage("status");          sms.SetMessage("status");
# Line 78  int main() Line 85  int main()
85                  SerialPort::STOP_BITS_1,                  SerialPort::STOP_BITS_1,
86                  SerialPort::FLOW_CONTROL_HARD );                  SerialPort::FLOW_CONTROL_HARD );
87    
88          GsmModem modem(port);          ModemTransceiver modem(port);
89          modem.Init();          modem.Init();
90    
91    
# Line 121  int main() Line 128  int main()
128          SMS sms;          SMS sms;
129          sms.sender = "12345678";          sms.sender = "12345678";
130          sms.message = "Tog list";          sms.message = "Tog list";
131          DebugGsmModem modem;          DebugModemTransceiver modem;
132          TogPlugin plugin;          TogPlugin plugin;
133    
134          plugin.Execute(modem, sms);          plugin.Execute(modem, sms);
# Line 161  int main() Line 168  int main()
168    
169          SerialPort port("/dev/ttyS1" );          SerialPort port("/dev/ttyS1" );
170          port.Open();          port.Open();
171          GsmModem modem(port);          ModemTransceiver modem(port);
172    
173          //modem.SendSms("22337617", "Hello, sir!");          //modem.SendSms("22337617", "Hello, sir!");
174          //          //

Legend:
Removed from v.142  
changed lines
  Added in v.158

  ViewVC Help
Powered by ViewVC 1.1.20