mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 01:57:39 -05:00
#190t P25 Phase 1 encrypted call status (#1906)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -52,6 +52,7 @@ import io.github.dsheirer.module.decode.ip.ipv4.IPV4Packet;
|
|||||||
import io.github.dsheirer.module.decode.ip.mototrbo.ars.ARSPacket;
|
import io.github.dsheirer.module.decode.ip.mototrbo.ars.ARSPacket;
|
||||||
import io.github.dsheirer.module.decode.ip.mototrbo.lrrp.LRRPPacket;
|
import io.github.dsheirer.module.decode.ip.mototrbo.lrrp.LRRPPacket;
|
||||||
import io.github.dsheirer.module.decode.ip.udp.UDPPacket;
|
import io.github.dsheirer.module.decode.ip.udp.UDPPacket;
|
||||||
|
import io.github.dsheirer.module.decode.p25.IServiceOptionsProvider;
|
||||||
import io.github.dsheirer.module.decode.p25.P25DecodeEvent;
|
import io.github.dsheirer.module.decode.p25.P25DecodeEvent;
|
||||||
import io.github.dsheirer.module.decode.p25.P25TrafficChannelManager;
|
import io.github.dsheirer.module.decode.p25.P25TrafficChannelManager;
|
||||||
import io.github.dsheirer.module.decode.p25.identifier.channel.APCO25Channel;
|
import io.github.dsheirer.module.decode.p25.identifier.channel.APCO25Channel;
|
||||||
@@ -382,10 +383,34 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
List<Identifier> updated = mPatchGroupManager.update(lcw.getIdentifiers(), timestamp);
|
List<Identifier> updated = mPatchGroupManager.update(lcw.getIdentifiers(), timestamp);
|
||||||
getIdentifierCollection().update(updated);
|
getIdentifierCollection().update(updated);
|
||||||
DecodeEventType decodeEventType = getLCDecodeEventType(lcw);
|
DecodeEventType decodeEventType = getLCDecodeEventType(lcw);
|
||||||
ServiceOptions serviceOptions = lcw.isEncrypted() ? VoiceServiceOptions.createEncrypted() :
|
|
||||||
VoiceServiceOptions.createUnencrypted();
|
|
||||||
|
ServiceOptions serviceOptions = null;
|
||||||
|
|
||||||
|
if(lcw instanceof IServiceOptionsProvider sop)
|
||||||
|
{
|
||||||
|
serviceOptions = sop.getServiceOptions();
|
||||||
|
}
|
||||||
|
else if(lcw.isEncrypted())
|
||||||
|
{
|
||||||
|
serviceOptions = VoiceServiceOptions.createEncrypted();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
serviceOptions = VoiceServiceOptions.createUnencrypted();
|
||||||
|
}
|
||||||
|
|
||||||
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), getCurrentChannel(), decodeEventType,
|
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), getCurrentChannel(), decodeEventType,
|
||||||
serviceOptions, getIdentifierCollection(), timestamp, null );
|
serviceOptions, getIdentifierCollection(), timestamp, null );
|
||||||
|
|
||||||
|
if(serviceOptions.isEncrypted())
|
||||||
|
{
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.ENCRYPTED));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CALL));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -776,9 +801,16 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
DecodeEventType type = headerData.isEncryptedAudio() ? DecodeEventType.CALL_ENCRYPTED : DecodeEventType.CALL;
|
DecodeEventType type = headerData.isEncryptedAudio() ? DecodeEventType.CALL_ENCRYPTED : DecodeEventType.CALL;
|
||||||
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), getCurrentChannel(), type,
|
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), getCurrentChannel(), type,
|
||||||
serviceOptions, mic, message.getTimestamp(), details);
|
serviceOptions, mic, message.getTimestamp(), details);
|
||||||
}
|
|
||||||
|
|
||||||
broadcast(new DecoderStateEvent(this, Event.START, State.CALL));
|
if(headerData.isEncryptedAudio())
|
||||||
|
{
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.START, State.ENCRYPTED));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.START, State.CALL));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -810,12 +842,14 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
getIdentifierCollection().update(esp.getIdentifiers());
|
getIdentifierCollection().update(esp.getIdentifiers());
|
||||||
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), esp.getEncryptionKey(),
|
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), esp.getEncryptionKey(),
|
||||||
message.getTimestamp());
|
message.getTimestamp());
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.ENCRYPTED));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getIdentifierCollection().remove(Form.ENCRYPTION_KEY);
|
getIdentifierCollection().remove(Form.ENCRYPTION_KEY);
|
||||||
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), null,
|
mTrafficChannelManager.processP1CurrentUser(getCurrentFrequency(), null,
|
||||||
message.getTimestamp());
|
message.getTimestamp());
|
||||||
|
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CALL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -824,7 +858,6 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CALL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class VoiceServiceOptions extends ServiceOptions
|
|||||||
*/
|
*/
|
||||||
public static VoiceServiceOptions createEncrypted()
|
public static VoiceServiceOptions createEncrypted()
|
||||||
{
|
{
|
||||||
return new VoiceServiceOptions(ENCRYPTION_FLAG);
|
return new VoiceServiceOptions(ENCRYPTION_FLAG + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,6 +78,6 @@ public class VoiceServiceOptions extends ServiceOptions
|
|||||||
*/
|
*/
|
||||||
public static VoiceServiceOptions createUnencrypted()
|
public static VoiceServiceOptions createUnencrypted()
|
||||||
{
|
{
|
||||||
return new VoiceServiceOptions(0);
|
return new VoiceServiceOptions(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user