Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rc2-core
Submodule rc2-core updated 4 files
+46 −2 RC2Server.cs
+2 −1 Radio.cs
+2 −2 WebRTC.Audio.cs
+194 −30 WebRTC.cs
8 changes: 8 additions & 0 deletions rc2-dvm/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public class TalkgroupConfigObject
/// Whether or not this talkgroup is included in the scanlist
/// </summary>
public bool Scan = true;
/// <summary>
/// Whether the talkgroup is nuisance deleted (should not be configured in the yml, internal use only)
/// </summary>
public bool NuisanceDeleted = false;
}

/// <summary>
Expand Down Expand Up @@ -253,6 +257,10 @@ public class NetworkConfigObject
/// Whether to enable additional debug messages
/// </summary>
public bool Debug = false;
/// <summary>
/// List of allowed subnets/networks for incoming WebRTC connections
/// </summary>
public List<IPNetwork> AllowedNetworks = new();
}

public class EncryptionConfigObject
Expand Down
19 changes: 0 additions & 19 deletions rc2-dvm/FneSystemBase.P25.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,25 +495,6 @@ protected override void P25DataReceived(object sender, P25DataReceivedEvent e)
foreach (VirtualChannel channel in RC2DVM.VirtualChannels)
{
channel.P25DataReceived(e, pktTime);
/**
// Don't send to channels that are transmitting
if (channel.IsTransmitting()) {
Log.Logger.Debug("({0:l}) Not sending data from P25 TG {1} to channel {2:l}, channel is currently transmitting", RC2DVM.fneSystem.SystemName, e.DstId, channel.Config.Name);
continue;
}
// Send data to any channel on the TG
if (channel.IsTalkgroupSelected(VocoderMode.P25, e.DstId))
{
Log.Logger.Debug("({0:l}) P25 TG {1} {2:l} -> {3:l}", RC2DVM.fneSystem.SystemName, e.DstId, Enum.GetName(typeof(P25DUID), e.DUID), channel.Config.Name);
channel.P25DataReceived(e, pktTime);
}
// Send to any channel with the ATG configured
else if (channel.Config.AnnouncementGroup == e.DstId)
{
Log.Logger.Debug("({0:l}) P25 ATG {1} {2:l} -> {3:l}", RC2DVM.fneSystem.SystemName, e.DstId, Enum.GetName(typeof(P25DUID), e.DUID), channel.Config.Name);
channel.P25DataReceived(e, pktTime);
}
// Send to any channel with the talkgroup in its scanlist*/
}

return;
Expand Down
34 changes: 26 additions & 8 deletions rc2-dvm/Radio.DVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal class DVMRadio : Radio
SoftkeyName.HOME,
SoftkeyName.SCAN,
SoftkeyName.SEC,
SoftkeyName.DEL
};

// Talkgroup list
Expand All @@ -39,8 +40,9 @@ internal class DVMRadio : Radio
public DVMRadio(
string name, bool rxOnly,
IPAddress listenAddress, int listenPort,
List<IPNetwork> allowedNetworks,
List<TalkgroupConfigObject> talkgroups, VirtualChannel vChannel,
Action<short[]> txAudioCallback, int txAudioSampleRate) : base(name, "", rxOnly, listenAddress, listenPort, DVMSoftkeys, null, null, txAudioCallback, txAudioSampleRate)
Action<short[]> txAudioCallback, int txAudioSampleRate) : base(name, "", rxOnly, listenAddress, listenPort, allowedNetworks, DVMSoftkeys, null, null, txAudioCallback, txAudioSampleRate)
{
this.talkgroups = talkgroups;
this.vChannel = vChannel;
Expand Down Expand Up @@ -98,17 +100,29 @@ public override bool ReleaseButton(SoftkeyName name)
Log.Logger.Warning("Talkgroup security is strapped secure, cannot toggle secure mode");
return false;
}
// If current talkgroup is not set up for encryption, bonk
// If current talkgroup is not set up for encryption
if (vChannel.CurrentTalkgroup.KeyId == 0 || vChannel.CurrentTalkgroup.AlgId == P25Defines.P25_ALGO_UNENCRYPT)
{
Log.Logger.Warning("Talkgroup is not configured for secure operation, cannot toggle secure mode");
return false;
// If we have secure enabled, disable it
if (vChannel.Secure)
{
vChannel.Secure = false;
Log.Logger.Information("Disabling secure mode for radio {name:l}, channel not configured for encryption", vChannel.Config.Name);
}
else
{
Log.Logger.Warning("Talkgroup is not configured for secure operation, cannot toggle secure mode");
return false;
}
}
else
{
// Toggle secure status
vChannel.Secure = !vChannel.Secure;
Log.Logger.Information("Toggling secure mode for radio {name:l}: {state:l}", vChannel.Config.Name, (vChannel.Secure ? "ON" : "OFF"));
}
// Toggle secure status
vChannel.Secure = !vChannel.Secure;
Log.Logger.Information("Toggling secure mode for radio {name:l}: {state:l}", vChannel.Config.Name, (vChannel.Secure ? "ON" : "OFF"));
// Return channel setup success/failure
return vChannel.SetupChannel();
return vChannel.SetupChannelCrypto();

// HOME
case SoftkeyName.HOME:
Expand All @@ -117,6 +131,10 @@ public override bool ReleaseButton(SoftkeyName name)
// SCAN
case SoftkeyName.SCAN:
return vChannel.ToggleScan();

// DEL (Nuisance Delete)
case SoftkeyName.DEL:
return vChannel.NuisanceDelete();

// Handle unhandled buttons
default:
Expand Down
Loading
Loading