Skip to content

Commit

Permalink
#1104 Resolves issue where all assembled DMR packet sequences are occ…
Browse files Browse the repository at this point in the history
…urring only on timeslot 2
  • Loading branch information
Dennis Sheirer committed Nov 20, 2021
1 parent 0c7dd19 commit 821e67a
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2020 Dennis Sheirer
* Copyright (C) 2014-2021 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -32,8 +32,8 @@
public class PacketSequenceAssembler
{
private Listener<IMessage> mMessageListener;
private PacketSequence mTimeslot0Sequence;
private PacketSequence mTimeslot1Sequence;
private PacketSequence mTimeslot2Sequence;

/**
* Constructs an instance
Expand All @@ -49,23 +49,23 @@ public PacketSequenceAssembler()
*/
private PacketSequence getPacketSequence(int timeslot)
{
if(timeslot == 0)
if(timeslot == 1)
{
if(mTimeslot0Sequence == null)
if(mTimeslot1Sequence == null)
{
mTimeslot0Sequence = new PacketSequence(1);
mTimeslot1Sequence = new PacketSequence(1);
}

return mTimeslot0Sequence;
return mTimeslot1Sequence;
}
else
{
if(mTimeslot1Sequence == null)
if(mTimeslot2Sequence == null)
{
mTimeslot1Sequence = new PacketSequence(2);
mTimeslot2Sequence = new PacketSequence(2);
}

return mTimeslot1Sequence;
return mTimeslot2Sequence;
}
}

Expand All @@ -84,7 +84,7 @@ public void setMessageListener(Listener<IMessage> listener)
*/
private void dispatchPacketSequence(int timeslot)
{
PacketSequence packetSequence = (timeslot == 0 ? mTimeslot0Sequence : mTimeslot1Sequence);
PacketSequence packetSequence = (timeslot == 1 ? mTimeslot1Sequence : mTimeslot2Sequence);

if(mMessageListener != null && packetSequence != null && packetSequence.isComplete())
{
Expand All @@ -96,13 +96,13 @@ private void dispatchPacketSequence(int timeslot)
}
}

if(timeslot == 0)
if(timeslot == 1)
{
mTimeslot0Sequence = null;
mTimeslot1Sequence = null;
}
else
{
mTimeslot1Sequence = null;
mTimeslot2Sequence = null;
}
}

Expand Down

0 comments on commit 821e67a

Please sign in to comment.