P25 and Airspy work in progress

Updated p25 decoder state to better track calls and call detects from
a trunked channel

Fixed issue with false detects on LDU2 encrypted call messages

Fixed Airspy channel allocation ... will allocate channels across the
entire bandwidth, minus 50 kHz on either end, and will not adjust the
center frequency if it's not needed.

Fixed traffic channel teardown -- traffic channels are immediately 
removed now, without a fade delay.

AudioMetadata - updated flag is now reset upon copying the metadata
This commit is contained in:
denny
2015-11-21 17:40:59 -05:00
parent a6c7c4f5d1
commit 4025f88951
11 changed files with 629 additions and 241 deletions

View File

@@ -38,7 +38,6 @@ public class P25AudioModule extends Module implements Listener<Message>,
private int mSourceID;
private static boolean mLibraryLoadStatusLogged = false;
private boolean mCanConvertAudio = false;
private boolean mEncryptedAudio = false;
private AudioConverter mAudioConverter;
private Listener<AudioPacket> mAudioPacketListener;
private AudioMetadata mAudioMetadata;
@@ -105,26 +104,17 @@ public class P25AudioModule extends Module implements Listener<Message>,
/* If we detect a valid LDU message with the encryption flag
* set to true, we toggle the encrypted audio state until we
* receive the first TDU or TDULC message, then reset it. */
if( ldu.isValid() && ldu.isEncrypted() )
{
mEncryptedAudio = true;
}
if( !mEncryptedAudio && mAudioConverter != null )
if( !( ldu.isValid() && ldu.isEncrypted() ) )
{
for( byte[] frame: ((LDUMessage)message).getIMBEFrames() )
{
float[] audio = mAudioConverter.decode( frame );
mAudioPacketListener.receive(
new AudioPacket( audio, mAudioMetadata ) );
new AudioPacket( audio, mAudioMetadata.copyOf() ) );
}
}
}
else if( message instanceof TDUMessage || message instanceof TDULinkControlMessage )
{
mEncryptedAudio = false;
}
}
}