From 385f31462beeb2514d606203f5e5dd756750dd87 Mon Sep 17 00:00:00 2001 From: Joey Grover Date: Wed, 24 Mar 2021 14:39:19 -0400 Subject: [PATCH] Add back frame sequence rollover fix In the clean up effort this was removed but needs to be added back --- .../java/com/smartdevicelink/protocol/SdlProtocolBase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java index e3621d598d..64578e7ee9 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java +++ b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java @@ -646,6 +646,13 @@ public void sendMessage(ProtocolMessage protocolMsg) { for (int i = 0; i < frameCount; i++) { frameSequenceNumber++; + + if (frameSequenceNumber == SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME) { + //If sequence numbers roll over to 0, increment again to avoid + //using the reserved sequence value for the final frame + ++frameSequenceNumber; + } + if (i == frameCount - 1) { frameSequenceNumber = SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME; }