-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathProgram.cs
More file actions
57 lines (53 loc) · 1.41 KB
/
Program.cs
File metadata and controls
57 lines (53 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Threading.Tasks;
using NetSdrClientApp;
using NetSdrClientApp.Networking;
namespace NetSdrClientApp
{
public static class Program
{
public static async Task Main()
{
Console.WriteLine(@"Usage:
C - connect
D - disconnet
F - set frequency
S - Start/Stop IQ listener
Q - quit");
var tcpClient = new TcpClientWrapper("127.0.0.1", 5000);
var udpClient = new UdpClientWrapper(60000);
var netSdr = new NetSdrClient(tcpClient, udpClient);
while (true)
{
var key = Console.ReadKey(intercept: true).Key;
if (key == ConsoleKey.C)
{
await netSdr.ConnectAsync();
}
else if (key == ConsoleKey.D)
{
netSdr.Disconnect();
}
else if (key == ConsoleKey.F)
{
await netSdr.ChangeFrequencyAsync(20000000, 1);
}
else if (key == ConsoleKey.S)
{
if (netSdr.IQStarted)
{
await netSdr.StopIQAsync();
}
else
{
await netSdr.StartIQAsync();
}
}
else if (key == ConsoleKey.Q)
{
break;
}
}
}
}
}