From 89b819c9fc1654bd65a341d1d0267e763a8202e6 Mon Sep 17 00:00:00 2001 From: john-wiens Date: Tue, 24 Sep 2024 16:30:24 -0600 Subject: [PATCH] Change allowed number of skip bits --- .../src/main/java/us/dot/its/jpo/ode/uper/UperUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/uper/UperUtil.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/uper/UperUtil.java index 1136ab357..04cb4cc46 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/uper/UperUtil.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/uper/UperUtil.java @@ -43,6 +43,7 @@ public static String stripDot2Header(String hexString, String payload_start_flag * Otherwise, returns just the payload. */ public static byte[] stripDot3Header(byte[] packet, HashMap msgStartFlags) { + String hexString = HexUtils.toHexString(packet); String hexPacketParsed = ""; @@ -145,11 +146,9 @@ public static int findValidStartFlagLocation(String hexString, String startFlag) int index = hexString.indexOf(startFlag); // If the message has a header, make sure not to missidentify the message by the header - // Maximum Header Length is 17 Bytes: https://www.researchgate.net/figure/WAVE-Short-Message-format-Reproduced-by-permission_fig6_224242297 - // At 2 Hex Chars per byte that is a maximum length of 38 if(index == 0 || index == -1){ - return -1; + return index; } else{ index = hexString.indexOf(startFlag,4);