--- smsdaemon/tester.cpp 2008/06/11 12:57:26 54 +++ smsdaemon/tester.cpp 2008/12/08 10:42:04 151 @@ -1,29 +1,134 @@ /* using http://sourceforge.net/projects/libserial/ + * */ #include #include #include -/*#include "SerialPort.h" -*/ -#include "GsmModem.h" +#include "serialport/SerialPort.h" + +#include "DebugTransceiver.h" +#include "SmsToolTransceiver.h" #include "Sms.h" -#include "TogPlugin.h" -#include "TrainInfo.h" +#include "plugins/TogPlugin.h" +#include "plugins/TrainInfo.h" #include "util.h" - +#include "plugins/StatusPlugin.h" +#include "SmsPdu.h" using namespace std; +using namespace Util; + +void test_sms(ISmsTransceiver& modem, int len) +{ + cout << "----- test_sms( " << len << " ) ------- " << endl; + + string msg = Util::str_formatint(len); + msg.append(1, ' '); + msg.append(len - msg.length(), 'a'); + + vector pdu = SmsPdu::CreateSmsPdu("22337617", msg, true); + + for (unsigned int i=0; i res = modem.ReadSms(true); + + for (unsigned int i = 0; i" << sms.message << "<" << endl; + cout << "Cmd: >" << cmd << "<" << endl; + cout << "Data >" << data << "<" << endl; + + Util::str_dump(sms.message); + //modem.SendSms(sms.sender, sms.message, false); + + } + +*/ +/* + vector pdu = SmsPdu::CreateSmsPdu("4522337617", "Hej med dig, igen", true); + cout << "Len: " << pdu[0].len << endl; + cout << "Pdu: " << pdu[0].pdu << endl; + + modem.SendSmsPdu(pdu[0].pdu, pdu[0].len); +*/ + + + +/* SMS sms; sms.sender = "12345678"; sms.message = "Tog list"; - DebugGsmModem modem; + DebugModemTransceiver modem; TogPlugin plugin; plugin.Execute(modem, sms); @@ -33,7 +138,7 @@ cout << "---- " << msg.length() << " ----" << endl; cout << msg << endl; - +*/ /* vector trains = GetTrainInfo("BJ","Bjerringbro"); @@ -63,7 +168,7 @@ SerialPort port("/dev/ttyS1" ); port.Open(); - GsmModem modem(port); + ModemTransceiver modem(port); //modem.SendSms("22337617", "Hello, sir!"); //