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

Diff of /smsdaemon/tester.cpp

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

revision 58 by torben, Wed Jun 11 12:57:26 2008 UTC revision 59 by torben, Wed Jun 11 19:42:24 2008 UTC
# Line 1  Line 1 
1  /* using http://sourceforge.net/projects/libserial/  /* using http://sourceforge.net/projects/libserial/
2     *
3   */   */
4    
5    
6  #include <string>  #include <string>
7  #include <iostream>  #include <iostream>
8  #include <vector>  #include <vector>
9  /*#include "SerialPort.h"  #include "SerialPort.h"
10  */  
11  #include "GsmModem.h"  #include "GsmModem.h"
12  #include "Sms.h"  #include "Sms.h"
13  #include "TogPlugin.h"  #include "TogPlugin.h"
14  #include "TrainInfo.h"  #include "TrainInfo.h"
15  #include "util.h"  #include "util.h"
16    
17    #include "SmsPdu.h"
18    
19  using namespace std;  using namespace std;
20    
21    
22  int main()  int main()
23  {  {
24        SerialPort port("/dev/ttyS1" );
25        port.Open( SerialPort::BAUD_9600,
26                            SerialPort::CHAR_SIZE_8,
27                            SerialPort::PARITY_NONE,
28                    SerialPort::STOP_BITS_1,
29                    SerialPort::FLOW_CONTROL_HARD );
30    
31            GsmModem modem(port);
32            modem.Init();
33    
34            int len;
35            std::string pdu = SmsPdu::CreateSmsPdu("4522337617", "Hej med dig", len);
36    
37            cout << "Len: " << len << endl;
38            cout << "Pdu: " << pdu << endl;
39            cout << "Pdu2:" << "0011000A9154223367710000AA0BC8B21AD42E9341E4F419" << endl;
40    
41    
42            modem.SendSmsPdu(pdu,len);
43                          
44    
45    /*
46          SMS sms;          SMS sms;
47          sms.sender = "12345678";          sms.sender = "12345678";
48          sms.message = "Tog list";          sms.message = "Tog list";
# Line 33  int main() Line 56  int main()
56    
57          cout << "---- " << msg.length() << " ----" << endl;          cout << "---- " << msg.length() << " ----" << endl;
58          cout << msg << endl;          cout << msg << endl;
59    */
60  /*  /*
61          vector<TrainInfo> trains = GetTrainInfo("BJ","Bjerringbro");          vector<TrainInfo> trains = GetTrainInfo("BJ","Bjerringbro");
62    

Legend:
Removed from v.58  
changed lines
  Added in v.59

  ViewVC Help
Powered by ViewVC 1.1.20