Skip to content

Commit

Permalink
check for sublabel and strip if found
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenbeijer committed Nov 19, 2023
1 parent 6539249 commit e084d78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions JAERO/arincparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,20 @@ void ArincParse::try_acars_apps(ACARSItem &acarsitem, la_msg_dir msg_dir)
}
else
{
// look for a sublabel and if found strip the sublabel(s) from the message before decoding
ba = acarsitem.message.toLatin1();
char sublabel[3];
char mfi[3];
int offset = la_acars_extract_sublabel_and_mfi(acarsitem.LABEL.data(), msg_dir, ba.data(),strlen( ba.data()), sublabel, mfi);

if(offset > 0)
{
ba = "/" + acarsitem.message.right(acarsitem.message.length()-offset).replace("- #" + QString(sublabel),"").trimmed().toLatin1();
}
else
{
ba = acarsitem.message.toLatin1();
}
}
if(ba.isEmpty())return;

Expand Down

0 comments on commit e084d78

Please sign in to comment.