Ensure the console actually closes

pull/1/head
firealarmss 11 months ago
parent 692ad204e6
commit e3728f12ff

@ -48,8 +48,11 @@ namespace WhackerLinkConsoleV2
public static string GetAliasByRid(List<RadioAlias> aliases, int rid)
{
if (aliases == null || aliases.Count == 0)
return string.Empty;
var match = aliases.FirstOrDefault(a => a.Rid == rid);
return match?.Alias;
return match?.Alias ?? string.Empty;
}
}
}

@ -690,7 +690,7 @@ namespace WhackerLinkConsoleV2
if (chunk.Length == 320)
{
P25EncodeAudioFrame(chunk, handler, channel, cpgChannel, system);
}
}
}
}
});
@ -1210,6 +1210,8 @@ namespace WhackerLinkConsoleV2
if (!e.IsSelected)
return;
FneUtils.Memset(e.mi, 0x00, P25Defines.P25_MI_LENGTH);
uint srcId = UInt32.Parse(system.Rid);
uint dstId = UInt32.Parse(cpgChannel.Tgid);
@ -1458,6 +1460,7 @@ namespace WhackerLinkConsoleV2
{
_settingsManager.SaveSettings();
base.OnClosing(e);
Application.Current.Shutdown();
}
private void ClearEmergency_Click(object sender, RoutedEventArgs e)
@ -1700,9 +1703,9 @@ namespace WhackerLinkConsoleV2
{
channel.mi[i] = (byte)random.Next(0x00, 0x100);
}
channel.crypter.Prepare(cpgChannel.GetAlgoId(), cpgChannel.GetKeyId(), ProtocolType.P25Phase1, channel.mi);
}
channel.crypter.Prepare(cpgChannel.GetAlgoId(), cpgChannel.GetKeyId(), ProtocolType.P25Phase1, channel.mi);
}
// crypto time
@ -2070,7 +2073,9 @@ namespace WhackerLinkConsoleV2
{
channel.IsReceiving = true;
slot.RxStart = pktTime;
// Console.WriteLine($"({system.Name}) P25D: Traffic *CALL START * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} [STREAM ID {e.StreamId}]");
Console.WriteLine($"({system.Name}) P25D: Traffic *CALL START * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} [STREAM ID {e.StreamId}]");
FneUtils.Memset(channel.mi, 0x00, P25Defines.P25_MI_LENGTH);
callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId);
callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, encrypted);
@ -2099,7 +2104,7 @@ namespace WhackerLinkConsoleV2
{
channel.IsReceiving = false;
TimeSpan callDuration = pktTime - slot.RxStart;
// Console.WriteLine($"({system.Name}) P25D: Traffic *CALL END * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} DUR {callDuration} [STREAM ID {e.StreamId}]");
Console.WriteLine($"({system.Name}) P25D: Traffic *CALL END * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} DUR {callDuration} [STREAM ID {e.StreamId}]");
channel.Background = (Brush)new BrushConverter().ConvertFrom("#FF0B004B");
callHistoryWindow.ChannelUnkeyed(cpgChannel.Name, (int)e.SrcId);
return;

Loading…
Cancel
Save

Powered by TurnKey Linux.