RDSSpy play stream reads RDS data (*) from TCP host:port. Default host is localhost and port is 3122.
* https://teknokoodiradio.vuodatus.net/lue/2019/11/sdr-rds-groups-to-rdsspy-spy-format-file-plugin
Set RDS source to (No Source)
rds1.spy file content:
620356A6138554F
62031560E1CC7
6203E56145206207
620356F7C614D49
6203256D20202020
.....
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace TCPlistener
{
class Program
{
static void Main(string[] args)
{
TcpListener server = null;
try
{
Int32 port = 3122;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
server = new TcpListener(localAddr, port);
server.Start();
NetworkStream stream = null;
TcpClient client = null;
while (true)
{
Console.Write("Waiting for a connection... ");
client = server.AcceptTcpClient();
stream = client.GetStream();
Console.WriteLine("Connected!");
break;
}
using (StreamReader sr = new StreamReader("c:\\utils\\sdr\\rds1.spy"))
{
string line;
while ((line = sr.ReadLine()) != null)
{
line = line + Environment.NewLine;
byte[] rds = Encoding.ASCII.GetBytes(line);
stream.Write(rds, 0, rds.Length);
// some delay is needed otherwise RDSSpy produces errors
System.Threading.Thread.Sleep(50);
Console.WriteLine(line);
}
}
client.Close();
}
catch (SocketException e)
{
Console.WriteLine("SocketException: {0}", e);
}
finally
{
server.Stop();
}
Console.WriteLine("\nHit enter to continue...");
Console.Read();
}
}
}
Kommentit
Tämän blogin kommentit tarkistetaan ennen julkaisua.