-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExeProgram.cs
More file actions
66 lines (60 loc) · 2.68 KB
/
Copy pathExeProgram.cs
File metadata and controls
66 lines (60 loc) · 2.68 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
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Net;
using System.Net.Sockets;
namespace AGWPEAPI
{
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Gray;
Console.BackgroundColor = ConsoleColor.Black;
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string text = fvi.ProductName + " " + fvi.FileVersion + " by " + fvi.CompanyName + "\r\n";
Console.WriteLine(text);
Console.WriteLine("AGWPE Bridge for Lanchonlh HG-UV98 APRS via Serial over Bluetooth");
Console.WriteLine(" Author: milokz@gmail.com ");
Console.WriteLine(" .. loading config.xml .. ");
Console.WriteLine();
CONFIG config = CONFIG.Load();
AGWPEServer server = new AGWPEServer(config.AGW_PORT, config.COM_PORT, config.BAUD_RATE);
server.MaxClients = config.MAX_CLIENTS;
try
{
server.Start();
}
catch (SocketException ex)
{
ConsoleColor was = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Socket Error [Port " + server.ServerPort.ToString() + "]: " + ex.Message);
Console.ForegroundColor = was;
Console.ReadLine();
return;
}
catch (Exception ex)
{
ConsoleColor was = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Error: " + ex.Message);
Console.ForegroundColor = was;
Console.ReadLine();
return;
};
Console.WriteLine("AGWPE Bridge Started at {0}", DateTime.Now);
Console.WriteLine(" - tcp://localhost:{0}/ - ", server.ServerPort);
Console.WriteLine(" - " + server.PortMode + " - ");
Console.WriteLine(" - Port 1: " + server.PortDescription);
Console.WriteLine();
Console.WriteLine("You can connect it using KMZViewer, APRSWin, UISS, UI-View32");
Console.WriteLine("Press Enter key to Exit");
Console.WriteLine("------------------------------ LOG -------------------------------");
Console.ReadLine();
server.Stop();
}
}
}