mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
P25 work in progress - final check-in of channel state and activity summary processing of TSBK and PDU messages and event generation.
This commit is contained in:
@@ -38,7 +38,7 @@ public class ThreadPoolManager
|
||||
{
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> schedule( ThreadType type,
|
||||
public ScheduledFuture<?> scheduleFixedRate( ThreadType type,
|
||||
Runnable command,
|
||||
long period,
|
||||
TimeUnit unit )
|
||||
@@ -66,6 +66,25 @@ public class ThreadPoolManager
|
||||
|
||||
}
|
||||
|
||||
public void scheduleOnce( Runnable command, long delay, TimeUnit unit )
|
||||
throws RejectedExecutionException
|
||||
{
|
||||
if( mExecutor == null )
|
||||
{
|
||||
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE );
|
||||
}
|
||||
|
||||
if( mTasks.size() <= MAX_TASK_COUNT )
|
||||
{
|
||||
mExecutor.schedule( command, delay, unit );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RejectedExecutionException( "Cannot schedule task - at "
|
||||
+ "max task count [" + mTasks.size() + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel( ScheduledFuture<?> task )
|
||||
{
|
||||
task.cancel( true );
|
||||
|
||||
@@ -209,24 +209,29 @@ public abstract class CallEvent
|
||||
|
||||
public enum CallEventType
|
||||
{
|
||||
ACKNOWLEDGE( "Acknowledge" ),
|
||||
CALL( "Call" ),
|
||||
CALL_ALERT( "Call Alert" ),
|
||||
CALL_END( "Call End" ),
|
||||
CALL_DETECT( "Call Detect" ),
|
||||
CALL_UNIQUE_ID( "UID Call" ),
|
||||
CALL_NO_TUNER( "Call - No Tuner" ),
|
||||
CALL_TIMEOUT( "Call Timeout" ),
|
||||
COMMAND( "Command" ),
|
||||
DATA_CALL( "Data Call" ),
|
||||
DEREGISTER( "Deregister" ),
|
||||
EMERGENCY( "EMERGENCY" ),
|
||||
FUNCTION( "Function" ),
|
||||
GPS( "GPS" ),
|
||||
ID_ANI( "ANI" ),
|
||||
ID_UNIQUE( "Unique ID" ),
|
||||
PAGE( "Page" ),
|
||||
QUERY( "Query" ),
|
||||
REGISTER( "Register" ),
|
||||
REGISTER_ESN( "ESN" ),
|
||||
REQUEST( "Request" ),
|
||||
SDM( "SDM" ),
|
||||
RESPONSE( "Response" ),
|
||||
SDM( "Short Data Message" ),
|
||||
STATUS( "Status" ),
|
||||
TELEPHONE_CALL( "Telephone Call" ),
|
||||
UNKNOWN( "Unknown" ),
|
||||
INVALID( "Invalid" );
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
{
|
||||
mProcessorTask =
|
||||
mResourceManager.getThreadPoolManager()
|
||||
.schedule( ThreadType.DECODER,
|
||||
.scheduleFixedRate( ThreadType.DECODER,
|
||||
new ComplexProcessor(),
|
||||
50, TimeUnit.MILLISECONDS );
|
||||
|
||||
@@ -305,7 +305,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
{
|
||||
mProcessorTask =
|
||||
mResourceManager.getThreadPoolManager()
|
||||
.schedule( ThreadType.DECODER,
|
||||
.scheduleFixedRate( ThreadType.DECODER,
|
||||
new RealProcessor(),
|
||||
50, TimeUnit.MILLISECONDS );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user