Skip to content

Commit

Permalink
Added External RDS Decoder option
Browse files Browse the repository at this point in the history
  • Loading branch information
veso266 committed Sep 22, 2019
1 parent 81a8cfd commit c33e7eb
Show file tree
Hide file tree
Showing 25 changed files with 1,539 additions and 977 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@ paket-files/
# JetBrains Rider
.idea/
*.sln.iml
Todo.txt
Todo.txt
Thumbs.db
Binary file not shown.
29 changes: 29 additions & 0 deletions Docs/ASCII G Protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
RDS data is provided by the RDS encoder in ASCII representation in this format:
```"G:"+#13+#10+"AAAABBBBCCCCDDDD"+#13+#10+#13+#10```
where
AAAA is PI,
BBBB is block 2,
CCCC is block 3,
DDDD is block 4 of the RDS group.

lets decipher this a bit
#13 is ASCII character for CR (Clear Line (\r))
#10 is ASCII character for LF (Line Feed (\n))

so in human readable format this would look like:
```
G:
AAAABBBBCCCCDDDD
```
or in computer form
```G:CRLFAAAABBBBCCCCDDDDCRLF```

in C# you would write it
```csharp
Console.WriteLine("G:");
Console.WriteLine("AAAABBBBCCCCDDDD");
Console.WriteLine();
Console.WriteLine();
```
File renamed without changes.
3 changes: 3 additions & 0 deletions Recievers-I-Use.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sdr://188.25.106.73:5555/ - Romania - Stations from Romania and Bulgaria receivable on 100.5 Rock FM in IBOC, It can also be seen in the README
sdr://212.139.208.227:5555/ - UK (Kent) - Stations from UK and France stations receivable
sdr://212.187.114.164:5556/ - UK (someLW and MW only) --- 747khz MCB Radio from The Netherlands is good choice for listening at daytime :)
105 changes: 103 additions & 2 deletions SDRSharp.XDR/AdvancedRDSWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 54 additions & 1 deletion SDRSharp.XDR/AdvancedRDSWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,67 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using SDRSharp.XDR.Tools;

namespace SDRSharp.XDR
{
public partial class AdvancedRDSWindow : Form
{
public AdvancedRDSWindow()
private static AdvancedRDSWindow form2;
ToolTip toolTip1 = new CustomToolTip();
private AdvancedRDSWindow()
{
InitializeComponent();
}

public static AdvancedRDSWindow Instance
{
//singleton design pattern to return always the same instance of a form
get
{
if (form2 == null || form2.IsDisposed)
{
form2 = new AdvancedRDSWindow();
form2.Text = "Advanced RDS Settings";
form2.NonClientMouseHover += form2.TitleHoveredEvent; //Hook into TitleHover event
if (!XDRPlugin.ExternalRDS)
form2.internalrds.Checked = true;
else
form2.rdsspy.Checked = true;
}
return form2;

}
}
private void TitleHoveredEvent(object sender, EventArgs e)
{
toolTip1.Show("You found the easter egg", this, 0, -100, 10000); //I have to write something as text otherwise tooltip won't appear
}
private void rdsspy_CheckedChanged(object sender, EventArgs e)
{
//Enable adress,port control if we are using External RDS Source
UDPListen.Enabled = true;
textBox1.Enabled = true;
textBox2.Enabled = true;
XDRPlugin.ExternalRDS = true;
}
private void internalrds_CheckedChanged(object sender, EventArgs e)
{
//Disable adress,port control if we are using Internal RDS Source
UDPListen.Enabled = false;
textBox1.Enabled = false;
textBox2.Enabled = false;
XDRPlugin.ExternalRDS = false;
}


private void UDPListen_Click(object sender, EventArgs e)
{
UDPServer.listenPort = Convert.ToInt32(textBox2.Text);
Thread RecieveUDP = new Thread(UDPServer.Serve);
RecieveUDP.Start();
RecieveUDP.IsBackground = true; //if this is not true we won't be able to close the SDR# because this will keep running and we don't want that
}
}
}
Loading

0 comments on commit c33e7eb

Please sign in to comment.