--- smsdaemon/tester.cpp 2008/06/11 16:14:28 58 +++ smsdaemon/tester.cpp 2008/06/11 19:42:24 59 @@ -1,25 +1,48 @@ /* using http://sourceforge.net/projects/libserial/ + * */ #include #include #include -/*#include "SerialPort.h" -*/ +#include "SerialPort.h" + #include "GsmModem.h" #include "Sms.h" #include "TogPlugin.h" #include "TrainInfo.h" #include "util.h" +#include "SmsPdu.h" using namespace std; int main() { + SerialPort port("/dev/ttyS1" ); + port.Open( SerialPort::BAUD_9600, + SerialPort::CHAR_SIZE_8, + SerialPort::PARITY_NONE, + SerialPort::STOP_BITS_1, + SerialPort::FLOW_CONTROL_HARD ); + + GsmModem modem(port); + modem.Init(); + + int len; + std::string pdu = SmsPdu::CreateSmsPdu("4522337617", "Hej med dig", len); + + cout << "Len: " << len << endl; + cout << "Pdu: " << pdu << endl; + cout << "Pdu2:" << "0011000A9154223367710000AA0BC8B21AD42E9341E4F419" << endl; + + + modem.SendSmsPdu(pdu,len); + +/* SMS sms; sms.sender = "12345678"; sms.message = "Tog list"; @@ -33,7 +56,7 @@ cout << "---- " << msg.length() << " ----" << endl; cout << msg << endl; - +*/ /* vector trains = GetTrainInfo("BJ","Bjerringbro");