diff --git a/APRS/APRSParser.cpp b/APRS/APRSParser.cpp index 0eeaabd..b5e60a2 100644 --- a/APRS/APRSParser.cpp +++ b/APRS/APRSParser.cpp @@ -138,6 +138,11 @@ bool CAPRSParser::parseInt(CAPRSFrame& frame) type = APFT_TELEMETRY; } break; + case ';' : + if( body.length() >= 10 && (body[9] == '*' || body[9] == '_')) { + type = APFT_OBJECT; + } + break; default: type = APFT_UNKNOWN; break; diff --git a/Tests/APRSParser/parseAPRSFrame.cpp b/Tests/APRSParser/parseAPRSFrame.cpp index a2d1ae1..59a8faa 100644 --- a/Tests/APRSParser/parseAPRSFrame.cpp +++ b/Tests/APRSParser/parseAPRSFrame.cpp @@ -173,6 +173,20 @@ namespace APRSParserTests EXPECT_EQ(aprsFrame.getPath().size(), 0); } + TEST_F(APRSParser_parseAPRSFrame, Object) + { + CAPRSFrame aprsFrame; + bool retVal = CAPRSParser::parseFrame("F8DSN-15>API510,DSTAR*:;F1ZBV *091510h4802.40N/00647.12ErPHG7430/A=003182R Vosges 145,6625@-0,6MHz", aprsFrame); + + EXPECT_TRUE(retVal); + EXPECT_STRCASEEQ(aprsFrame.getBody().c_str(), ";F1ZBV *091510h4802.40N/00647.12ErPHG7430/A=003182R Vosges 145,6625@-0,6MHz"); + EXPECT_STRCASEEQ(aprsFrame.getDestination().c_str(), "API510"); + EXPECT_STRCASEEQ(aprsFrame.getSource().c_str(), "F8DSN-15"); + EXPECT_EQ(aprsFrame.getType(), APFT_OBJECT); + EXPECT_EQ(aprsFrame.getPath().size(), 1); + EXPECT_STRCASEEQ(aprsFrame.getPath().at(0).c_str(), "DSTAR*"); + } + TEST_F(APRSParser_parseAPRSFrame, messageToSelf) { CAPRSFrame aprsFrame;