fix playback box; update fnecore submodule

pull/1/head
firealarmss 11 months ago
parent 4eeacdd5fd
commit a6c407394a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -12,8 +12,10 @@
* *
*/ */
using System.Diagnostics;
using fnecore; using fnecore;
using fnecore.P25; using fnecore.P25;
using fnecore.P25.LC.TSBK;
namespace dvmconsole namespace dvmconsole
{ {
@ -488,6 +490,21 @@ namespace dvmconsole
{ {
DateTime pktTime = DateTime.Now; DateTime pktTime = DateTime.Now;
// TODO: Handle TSBKs
if (e.DUID == P25DUID.TSDU)
{
byte lco = e.Data[4];
switch (lco)
{
case P25Defines.TSBK_IOSP_ACK_RSP:
break;
case P25Defines.TSBK_IOSP_CALL_ALRT:
break;
}
}
if (e.DUID == P25DUID.HDU || e.DUID == P25DUID.TSDU || e.DUID == P25DUID.PDU) if (e.DUID == P25DUID.HDU || e.DUID == P25DUID.TSDU || e.DUID == P25DUID.PDU)
return; return;

@ -127,7 +127,7 @@ namespace dvmconsole
continue; continue;
} }
bool hasKey = channelBox.Crypter.HasKey(cpgChannel.GetKeyId()); bool hasKey = channelBox.Crypter.HasKey();
KeyStatusItems.Add(new KeyStatusItem KeyStatusItems.Add(new KeyStatusItem
{ {

@ -52,7 +52,7 @@
</ScrollViewer> </ScrollViewer>
<!-- Application Banner --> <!-- Application Banner -->
<Image Height="50" Grid.Row="1" VerticalAlignment="Center" Source="/Assets/DvmLogo.png" Stretch="UniformToFill" Margin="0,0,634,0" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Width="231"> <Image Height="50" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Source="/Assets/DvmLogo.png" Stretch="UniformToFill" Margin="5,0,0,0" RenderTransformOrigin="0.5,0.5" Width="224">
<Image.RenderTransform> <Image.RenderTransform>
<TransformGroup> <TransformGroup>
<ScaleTransform/> <ScaleTransform/>

@ -35,6 +35,7 @@ using Constants = fnecore.Constants;
using fnecore; using fnecore;
using fnecore.P25; using fnecore.P25;
using fnecore.P25.LC.TSBK; using fnecore.P25.LC.TSBK;
using fnecore.P25.kmm;
namespace dvmconsole namespace dvmconsole
@ -282,8 +283,6 @@ namespace dvmconsole
{ {
var channelBox = new ChannelBox(selectedChannelsManager, audioManager, channel.Name, channel.System, channel.Tgid); var channelBox = new ChannelBox(selectedChannelsManager, audioManager, channel.Name, channel.System, channel.Tgid);
//channelBox.crypter.AddKey(channel.GetKeyId(), channel.GetAlgoId(), channel.GetEncryptionKey());
systemStatuses.Add(channel.Name, new SlotStatus()); systemStatuses.Add(channel.Name, new SlotStatus());
if (settingsManager.ChannelPositions.TryGetValue(channel.Name, out var position)) if (settingsManager.ChannelPositions.TryGetValue(channel.Name, out var position))
@ -396,16 +395,12 @@ namespace dvmconsole
foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels()) foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels())
{ {
if (channel.SystemName == PLAYBACKSYS || channel.ChannelName == PLAYBACKCHNAME || channel.DstId == PLAYBACKTG) if (channel.SystemName == PLAYBACKSYS || channel.ChannelName == PLAYBACKCHNAME || channel.DstId == PLAYBACKTG)
{
playbackChannelBox.IsReceiving = true;
continue; continue;
}
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName); Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName); Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName);
Task.Run(() =>
{
PeerSystem handler = fneSystemManager.GetFneSystem(system.Name); PeerSystem handler = fneSystemManager.GetFneSystem(system.Name);
if (channel.IsSelected && channel.PttState) if (channel.IsSelected && channel.PttState)
@ -414,6 +409,8 @@ namespace dvmconsole
int samples = 320; int samples = 320;
Task.Run(() =>
{
channel.chunkedPcm = AudioConverter.SplitToChunks(e.Buffer); channel.chunkedPcm = AudioConverter.SplitToChunks(e.Buffer);
foreach (byte[] chunk in channel.chunkedPcm) foreach (byte[] chunk in channel.chunkedPcm)
@ -423,11 +420,11 @@ namespace dvmconsole
else else
Trace.WriteLine("bad sample length: " + chunk.Length); Trace.WriteLine("bad sample length: " + chunk.Length);
} }
}
}); });
} }
}
if (isAnyTgOn && playbackChannelBox.IsSelected) if (playbackChannelBox != null && isAnyTgOn && playbackChannelBox.IsSelected)
audioManager.AddTalkgroupStream(PLAYBACKTG, e.Buffer); audioManager.AddTalkgroupStream(PLAYBACKTG, e.Buffer);
} }
@ -491,13 +488,10 @@ namespace dvmconsole
}; };
byte[] tsbk = new byte[P25Defines.P25_TSBK_LENGTH_BYTES]; byte[] tsbk = new byte[P25Defines.P25_TSBK_LENGTH_BYTES];
byte[] payload = new byte[P25Defines.P25_TSBK_LENGTH_BYTES];
callAlert.Encode(ref tsbk, ref payload, true, true); callAlert.Encode(ref tsbk);
handler.SendP25TSBK(callData, tsbk); handler.SendP25TSBK(callData, tsbk);
Trace.WriteLine("Transmitted Page");
} }
} }
@ -1224,12 +1218,9 @@ namespace dvmconsole
// Convert to signal // Convert to signal
DiscreteSignal signal = new DiscreteSignal(8000, fSamples, true); DiscreteSignal signal = new DiscreteSignal(8000, fSamples, true);
// Log.Logger.Debug($"SAMPLE BUFFER {FneUtils.HexDump(samples)}");
// encode PCM samples into IMBE codewords // encode PCM samples into IMBE codewords
byte[] imbe = new byte[FneSystemBase.IMBE_BUF_LEN]; byte[] imbe = new byte[FneSystemBase.IMBE_BUF_LEN];
int tone = 0; int tone = 0;
if (true) // TODO: Disable/enable detection if (true) // TODO: Disable/enable detection
@ -1469,7 +1460,7 @@ namespace dvmconsole
{ {
Task.Run(() => Task.Run(() =>
{ {
HandleEmergency(e.SrcId.ToString(), e.DstId.ToString()); HandleEmergency(e.DstId.ToString(), e.SrcId.ToString());
}); });
} }
@ -1524,12 +1515,19 @@ namespace dvmconsole
{ {
foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels()) foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels())
{ {
if (channel.SystemName == PLAYBACKSYS || channel.ChannelName == PLAYBACKCHNAME || channel.DstId == PLAYBACKTG)
continue;
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName); Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName); Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName);
PeerSystem handler = fneSystemManager.GetFneSystem(system.Name); PeerSystem handler = fneSystemManager.GetFneSystem(system.Name);
if (cpgChannel.GetKeyId() != 0 && cpgChannel.GetAlgoId() != 0) ushort keyId = cpgChannel.GetKeyId();
channel.Crypter.AddKey(key.KeyId, e.KmmKey.KeysetItem.AlgId, key.GetKey()); byte algoId = cpgChannel.GetAlgoId();
KeysetItem receivedKey = e.KmmKey.KeysetItem;
if (keyId != 0 && algoId != 0 && keyId == key.KeyId && algoId == receivedKey.AlgId)
channel.Crypter.SetKey(key.KeyId, receivedKey.AlgId, key.GetKey());
} }
}); });
} }
@ -1566,6 +1564,9 @@ namespace dvmconsole
{ {
foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels()) foreach (ChannelBox channel in selectedChannelsManager.GetSelectedChannels())
{ {
if (channel.SystemName == PLAYBACKSYS || channel.ChannelName == PLAYBACKCHNAME || channel.DstId == PLAYBACKTG)
continue;
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName); Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName); Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName);

@ -1 +1 @@
Subproject commit 1e1f6379f62286412281d61dec08641e61c34949 Subproject commit 305db64cf26b223736863f3ac4a268c1f25eebaa
Loading…
Cancel
Save

Powered by TurnKey Linux.