Properly receive and sorta transmit on multi talkgroups

pull/1/head
firealarmss 1 year ago
parent bc8a572055
commit 17a190c4ee

@ -0,0 +1,36 @@
/*
* WhackerLink - WhackerLinkConsoleV2
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2025 Caleb, K4PHP
*
*/
using System.Runtime.InteropServices;
namespace WhackerLinkConsoleV2
{
public static class ConsoleNative
{
[DllImport("kernel32.dll")]
private static extern bool AllocConsole();
public static void ShowConsole()
{
AllocConsole();
Console.WriteLine("Console attached.");
}
}
}

@ -68,6 +68,9 @@ namespace WhackerLinkConsoleV2
public MainWindow()
{
#if DEBUG
ConsoleNative.ShowConsole();
#endif
InitializeComponent();
_settingsManager.LoadSettings();
_selectedChannelsManager = new SelectedChannelsManager();
@ -348,9 +351,6 @@ namespace WhackerLinkConsoleV2
};
handler.SendMessage(voicePaket);
} else
{
_stopSending = true;
}
}
}
@ -705,14 +705,10 @@ namespace WhackerLinkConsoleV2
if (channel.PttState && response.Status == (int)ResponseType.GRANT && response.Channel != null && response.SrcId == system.Rid && response.DstId == cpgChannel.Tgid)
{
MessageBox.Show($"here1");
channel.VoiceChannel = response.Channel;
_stopSending = false;
} else if (response.Status == (int)ResponseType.GRANT && response.SrcId != system.Rid && response.DstId == cpgChannel.Tgid)
{
MessageBox.Show($"here2");
channel.VoiceChannel = response.Channel;
channel.LastSrcId = "Last SRC: " + response.SrcId;
Dispatcher.Invoke(() =>
@ -721,24 +717,20 @@ namespace WhackerLinkConsoleV2
});
} else if (channel.PageState && response.Status == (int)ResponseType.GRANT && response.Channel != null && response.SrcId == system.Rid && response.DstId == cpgChannel.Tgid)
{
MessageBox.Show($"here3");
channel.VoiceChannel = response.Channel;
}
else
{
MessageBox.Show($"here4");
Dispatcher.Invoke(() =>
{
if (channel.IsSelected)
channel.Background = new SolidColorBrush(Colors.DodgerBlue);
else
channel.Background = new SolidColorBrush(Colors.Gray);
});
channel.VoiceChannel = null;
_stopSending = true;
//Dispatcher.Invoke(() =>
//{
// if (channel.IsSelected)
// channel.Background = new SolidColorBrush(Colors.DodgerBlue);
// else
// channel.Background = new SolidColorBrush(Colors.Gray);
//});
//channel.VoiceChannel = null;
//_stopSending = true;
}
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.