Skip to content

Commit

Permalink
addressing drew's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael7371 committed Nov 21, 2023
1 parent 26eb9da commit d6882e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,8 @@ private void publishList(XmlUtils xmlUtils, List<OdeData> dataList) throws JsonP
logger.debug("Publishing a TIM or MAP");
}

if (isSpatRecord() && msgMetadata instanceof OdeSpatMetadata
&& !((OdeSpatMetadata) msgMetadata).getIsCertPresent()) {
// Nothing: If Spat log file and IEEE1609Cert is not present, Skip the
// Ieee1609Dot2Data encoding
} else {
if (!(isSpatRecord() && msgMetadata instanceof OdeSpatMetadata
&& !((OdeSpatMetadata) msgMetadata).getIsCertPresent())) {
if (checkHeader(msgPayload) == "Ieee1609Dot2Data") {
Asn1Encoding msgEncoding = new Asn1Encoding("root", "Ieee1609Dot2Data", EncodingRule.COER);
msgMetadata.addEncoding(msgEncoding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ public byte[] removeHeader(byte[] packet) {
logger.debug("Start index for: " + key + " is: " + startIndex);
if (startIndex == -1) {
logger.debug("Message does not have header for: " + key);
break;
} else if (startIndex <= HEADER_SIZE) {
logger.debug("Message has supported header. startIndex: " + startIndex + " msgFlag: " + startFlag);
hexPacketParsed = hexPacket;
// Using a value of 35 as the largest index from preliminary testing data.
} else if (startIndex > HEADER_SIZE && startIndex < 35) {
int trueStartIndex = HEADER_SIZE
+ hexPacket.substring(HEADER_SIZE, hexPacket.length()).indexOf(startFlag);
Expand Down

0 comments on commit d6882e1

Please sign in to comment.