using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using fnecore.DMR;
using fnecore;
namespace WhackerLinkConsoleV2
{
///
/// Represents the individual timeslot data status.
///
public class SlotStatus
{
///
/// Rx Start Time
///
public DateTime RxStart = DateTime.Now;
///
///
///
public uint RxSeq = 0;
///
/// Rx RF Source
///
public uint RxRFS = 0;
///
/// Tx RF Source
///
public uint TxRFS = 0;
///
/// Rx Stream ID
///
public uint RxStreamId = 0;
///
/// Tx Stream ID
///
public uint TxStreamId = 0;
///
/// Rx TG ID
///
public uint RxTGId = 0;
///
/// Tx TG ID
///
public uint TxTGId = 0;
///
/// Tx Privacy TG ID
///
public uint TxPITGId = 0;
///
/// Rx Time
///
public DateTime RxTime = DateTime.Now;
///
/// Tx Time
///
public DateTime TxTime = DateTime.Now;
///
/// Rx Type
///
public FrameType RxType = FrameType.TERMINATOR;
/** DMR Data */
///
/// Rx Link Control Header
///
public LC DMR_RxLC = null;
///
/// Rx Privacy Indicator Link Control Header
///
public PrivacyLC DMR_RxPILC = null;
///
/// Tx Link Control Header
///
public LC DMR_TxHLC = null;
///
/// Tx Privacy Link Control Header
///
public PrivacyLC DMR_TxPILC = null;
///
/// Tx Terminator Link Control
///
public LC DMR_TxTLC = null;
} // public class SlotStatus
///
/// Implements a FNE system.
///
public abstract partial class FneSystemBase : fnecore.FneSystemBase
{
public List processedChunks = new List();
private Random rand;
internal MainWindow mainWindow;
// List of active calls
private List<(uint, byte)> activeTalkgroups = new List<(uint, byte)>();
/*
** Methods
*/
///
/// Initializes a new instance of the class.
///
/// Instance of or
public FneSystemBase(FnePeer fne, MainWindow mainWindow) : base(fne, 0)
{
this.fne = fne;
this.mainWindow = mainWindow;
this.rand = new Random(Guid.NewGuid().GetHashCode());
// hook logger callback
this.fne.Logger = (LogLevel level, string message) =>
{
switch (level)
{
case LogLevel.WARNING:
Console.WriteLine(message);
break;
case LogLevel.ERROR:
Console.WriteLine(message);
break;
case LogLevel.DEBUG:
Console.WriteLine(message);
break;
case LogLevel.FATAL:
Console.WriteLine(message);
break;
case LogLevel.INFO:
default:
Console.WriteLine(message);
break;
}
};
}
///
/// Stops the main execution loop for this .
///
public override void Stop()
{
base.Stop();
}
///
/// Callback used to process whether or not a peer is being ignored for traffic.
///
/// Peer ID
/// Source Address
/// Destination Address
/// Slot Number
/// Call Type (Group or Private)
/// Frame Type
/// DMR Data Type
/// Stream ID
/// True, if peer is ignored, otherwise false.
protected override bool PeerIgnored(uint peerId, uint srcId, uint dstId, byte slot, fnecore.CallType callType, FrameType frameType, DMRDataType dataType, uint streamId)
{
return false;
}
///
/// Event handler used to handle a peer connected event.
///
///
///
protected override void PeerConnected(object sender, PeerConnectedEvent e)
{
return;
}
///
/// Returns a new stream ID
///
///
public uint NewStreamId()
{
return (uint)rand.Next(int.MinValue, int.MaxValue);
}
} // public abstract partial class FneSystemBase : fnecore.FneSystemBase
}