summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2021-03-24 14:39:19 -0400
committerJoey Grover <joeygrover@gmail.com>2021-03-24 14:39:19 -0400
commit385f31462beeb2514d606203f5e5dd756750dd87 (patch)
tree999904d7f7cae7b1623ecfb0d97bf3b9c5ce1575
parentfa9301e8a1680fbcf9ce4d8dfccf63b10366263c (diff)
downloadsdl_android-bugfix/issue_1642.tar.gz
Add back frame sequence rollover fixbugfix/issue_1642
In the clean up effort this was removed but needs to be added back
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
index e3621d598..64578e7ee 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 class SdlProtocolBase {
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;
}