#959 Updates DMR decode event tracking and Con+ channel grant management. (#978)

Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
Denny Sheirer
2020-10-25 04:51:36 -04:00
committed by GitHub
parent fe714c69a7
commit de8cfa24f9
15 changed files with 408 additions and 237 deletions

View File

@@ -34,7 +34,7 @@ import io.github.dsheirer.protocol.Protocol;
public class DecodeEvent implements IDecodeEvent
{
private long mTimeStart;
private long mDuration;
private long mTimeEnd;
private String mEventDescription;
private IdentifierCollection mIdentifierCollection;
private IChannelDescriptor mChannelDescriptor;
@@ -66,7 +66,7 @@ public class DecodeEvent implements IDecodeEvent
{
if(timestamp > mTimeStart)
{
mDuration = timestamp - mTimeStart;
mTimeEnd = timestamp;
}
}
@@ -87,13 +87,26 @@ public class DecodeEvent implements IDecodeEvent
return mTimeStart;
}
/**
* Event end in milliseconds
*/
public long getTimeEnd()
{
return mTimeEnd;
}
/**
* Event duration in milliseconds
*/
@Override
public long getDuration()
{
return mDuration;
if(mTimeEnd < mTimeStart)
{
return 0;
}
return mTimeEnd - mTimeStart;
}
/**
@@ -101,7 +114,7 @@ public class DecodeEvent implements IDecodeEvent
*/
public void setDuration(long duration)
{
mDuration = duration;
mTimeEnd = mTimeStart + duration;
}
/**
@@ -229,7 +242,7 @@ public class DecodeEvent implements IDecodeEvent
{
sb.append(" IDS:").append(Joiner.on(",").join(mIdentifierCollection.getIdentifiers()));
}
sb.append(" DURATION:").append(mDuration);
sb.append(" DURATION:").append(getDuration());
sb.append(" CHANNEL:").append(mChannelDescriptor);
return sb.toString();
}

View File

@@ -38,6 +38,12 @@ public interface IDecodeEvent
*/
long getTimeStart();
/**
* Event end time
* @return timestamp in milliseconds
*/
long getTimeEnd();
/**
* Event duration.
*