--- smsdaemon/tester.cpp 2008/06/11 19:42:24 59 +++ smsdaemon/tester.cpp 2008/06/12 18:54:24 68 @@ -19,8 +19,38 @@ using namespace std; +void test_sms(GsmModem& 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("4522337617", msg, true); + + for (unsigned int i=0; i temp = SmsPdu::Encode7to8bit("Dette er en test af encode"); + cout << SmsPdu::HexformatVector(temp) << endl; + + string result = SmsPdu::Decode8to7bit(temp); + cout << result << endl; + + return 0; + + SerialPort port("/dev/ttyS1" ); port.Open( SerialPort::BAUD_9600, SerialPort::CHAR_SIZE_8, @@ -31,15 +61,15 @@ 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; + test_sms(modem, 161); +/* + 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); +*/ - modem.SendSmsPdu(pdu,len); /*