diff options
-rw-r--r-- | host/commands/modem_simulator/pdu_parser.cpp | 2 | ||||
-rw-r--r-- | host/commands/modem_simulator/unittest/pdu_parser_test.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/host/commands/modem_simulator/pdu_parser.cpp b/host/commands/modem_simulator/pdu_parser.cpp index 5cc425e59..45647caad 100644 --- a/host/commands/modem_simulator/pdu_parser.cpp +++ b/host/commands/modem_simulator/pdu_parser.cpp @@ -100,7 +100,7 @@ bool PDUParser::DecodePDU(std::string& pdu) { int offset = ud_length / 8; pos -= offset * 2; } else if (data_code_scheme_ == "08") { // GSM_UCS2 - pos += ud_length; + pos += ud_length * 2 + 2; } else { pos += ud_length * 2 + 2; } diff --git a/host/commands/modem_simulator/unittest/pdu_parser_test.cpp b/host/commands/modem_simulator/unittest/pdu_parser_test.cpp index 4129aa126..5a93f909c 100644 --- a/host/commands/modem_simulator/unittest/pdu_parser_test.cpp +++ b/host/commands/modem_simulator/unittest/pdu_parser_test.cpp @@ -21,6 +21,10 @@ TEST(PDUParserTest, IsValidPDU_true) { std::string pdu = "0001000D91688118109844F0000017AFD7903AB55A9BBA69D639D4ADCBF99E3DCCAE9701"; cuttlefish::PDUParser smspdu(pdu); EXPECT_TRUE(smspdu.IsValidPDU()); + + std::string pdu_unicode = "000100048145540008024F60"; + cuttlefish::PDUParser pduUnicode(pdu_unicode); + EXPECT_TRUE(pduUnicode.IsValidPDU()); } TEST(PDUParserTest, IsValidPDU_false) { |