/[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 149 by torben, Sun Dec 7 20:58:41 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 "Sms.h"  #include "Sms.h"
13  #include "plugins/TogPlugin.h"  #include "plugins/TogPlugin.h"
14  #include "plugins/TrainInfo.h"  #include "plugins/TrainInfo.h"
# Line 19  Line 19 
19  using namespace std;  using namespace std;
20  using namespace Util;  using namespace Util;
21    
22  void test_sms(GsmModem& modem, int len)  void test_sms(ISmsTransceiver& modem, int len)
23  {  {
24          cout << "----- test_sms( " << len << " ) ------- " << endl;          cout << "----- test_sms( " << len << " ) ------- " << endl;
25    
# Line 35  void test_sms(GsmModem& modem, int len) Line 35  void test_sms(GsmModem& modem, int len)
35                  cout << "Len: " << pdu[i].len << endl;                  cout << "Len: " << pdu[i].len << endl;
36                  cout << "Pdu: " << pdu[i].pdu << endl;                  cout << "Pdu: " << pdu[i].pdu << endl;
37    
38                  modem.SendSmsPdu(pdu[i].pdu, pdu[i].len);  //              modem.SendSmsPdu(pdu[i].pdu, pdu[i].len);
39          }          }
40  }  }
41    
# Line 51  int main() Line 51  int main()
51          cout << end << endl;          cout << end << endl;
52          return 0;          return 0;
53  */  */
54          string start = "hej æøåÆØÅ";          string start = "hej ������";
55          string mid = str_latin2gsm(start);          string mid = str_latin2gsm(start);
56          string final = str_gsm2latin(mid);          string final = str_gsm2latin(mid);
57    
# Line 62  int main() Line 62  int main()
62    
63          return 0;          return 0;
64    
65          DebugGsmModem modem(true);          DebugTransceiver modem(true);
66          SMS sms;          SMS sms;
67          sms.SetSender("1234");          sms.SetSender("1234");
68          sms.SetMessage("status");          sms.SetMessage("status");
# Line 78  int main() Line 78  int main()
78                  SerialPort::STOP_BITS_1,                  SerialPort::STOP_BITS_1,
79                  SerialPort::FLOW_CONTROL_HARD );                  SerialPort::FLOW_CONTROL_HARD );
80    
81          GsmModem modem(port);          ModemTransceiver modem(port);
82          modem.Init();          modem.Init();
83    
84    
# Line 121  int main() Line 121  int main()
121          SMS sms;          SMS sms;
122          sms.sender = "12345678";          sms.sender = "12345678";
123          sms.message = "Tog list";          sms.message = "Tog list";
124          DebugGsmModem modem;          DebugModemTransceiver modem;
125          TogPlugin plugin;          TogPlugin plugin;
126    
127          plugin.Execute(modem, sms);          plugin.Execute(modem, sms);
# Line 161  int main() Line 161  int main()
161    
162          SerialPort port("/dev/ttyS1" );          SerialPort port("/dev/ttyS1" );
163          port.Open();          port.Open();
164          GsmModem modem(port);          ModemTransceiver modem(port);
165    
166          //modem.SendSms("22337617", "Hello, sir!");          //modem.SendSms("22337617", "Hello, sir!");
167          //          //

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

  ViewVC Help
Powered by ViewVC 1.1.20