Skip to content

Commit

Permalink
First working version and a screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
veso266 committed Aug 6, 2019
1 parent c987075 commit ccf32cf
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 16 deletions.
Binary file added IMGS/SDRSharp.XDRv0.5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added IMGS/Thumbs.db
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ but things that work are:
```xml
<add key="Whatever-you-want-that-is-unique" value="NameSpace.EntryPoint.DLLName" />
```
![SDRSharp.XDR](IMGS/SDRSharp.XDRv0.5.PNG?raw=true "How it looks like when it works :)")
57 changes: 48 additions & 9 deletions SDRSharp.XDR/RDS/RDSFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,60 @@ public static void sdr_read_rds(ref RdsFrame _rdsFrame)
uint rds_timer = 0;
byte[] rds_buffer = new byte[4];
byte rds_status_buffer;
//byte status = dsp_read_16(DSP_RDS_STATUS);
byte status = AnalyseRDS(_rdsFrame.GroupB);
//ushort buffer = dsp_read_16(DSP_RDS_DATA);
byte current_pi_count = 0;
byte current_pi_errorfree = 0;
byte current_pi_state;
Debug.WriteLine(_rdsFrame.Filter);

//SP.Write("R");
//serial_hex((byte)_rdsFrame.GroupA);
//serial_hex((byte)_rdsFrame.GroupB);
//serial_hex((byte)_rdsFrame.GroupC);
//serial_hex((byte)_rdsFrame.GroupD);
//SP.Write("\n");
//SP.Write((status & 0xF800).ToString("X4"));
//SP.Write("\r\n");

//Debug.WriteLine(_rdsFrame.GroupA.ToString("X4"));
}

public static byte AnalyseRDS(ushort groupB)
{
//SP.Write((groupB & 0xf800).ToString("X4"));
//SP.Write(((groupType)(groupB >> 11)).ToString()); //Group B contains Group Type info
//SP.Write(((byte)(groupB >> 11)).ToString("X4")); //Group B contains Group Type info
SP.Write((groupB & 0xF800).ToString("X4"));
SP.Write("\r\n");
return (byte)(groupB >> 11);
}
private enum groupType : byte
{
RDS_TYPE_0A = 0x0000,
RDS_TYPE_0B = 0x0001,
RDS_TYPE_1A = 0x0002,
RDS_TYPE_1B = 0x0003,
RDS_TYPE_2A = 0x0004,
RDS_TYPE_2B = 0x0005,
RDS_TYPE_3A = 0x0006,
RDS_TYPE_3B = 0x0007,
RDS_TYPE_4A = 0x0008,
RDS_TYPE_4B = 0x0009,
RDS_TYPE_5A = 0x000A,
RDS_TYPE_5B = 0x000B,
RDS_TYPE_6A = 0x000C,
RDS_TYPE_6B = 0x000D,
RDS_TYPE_7A = 0x000E,
RDS_TYPE_7B = 0x000F,
RDS_TYPE_8A = 0x0010,
RDS_TYPE_8B = 0x0011,
RDS_TYPE_9A = 0x0012,
RDS_TYPE_9B = 0x0013,
RDS_TYPE_10A = 0x0014,
RDS_TYPE_10B = 0x0015,
RDS_TYPE_11A = 0x0016,
RDS_TYPE_11B = 0x0017,
RDS_TYPE_12A = 0x0018,
RDS_TYPE_12B = 0x0019,
RDS_TYPE_13A = 0x001A,
RDS_TYPE_13B = 0x001B,
RDS_TYPE_14A = 0x001C,
RDS_TYPE_14B = 0x001D,
RDS_TYPE_15A = 0x001E,
RDS_TYPE_15B = 0x001F
}
}
}
19 changes: 12 additions & 7 deletions SDRSharp.XDR/SerialCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,22 @@ public static void ComThreadEngine()
}
catch (TimeoutException) //It updates to slowly so why not sent it when nothing is happening :)
{

//Signal, stereo and RDS :)
SP.Write("\r\n");
SP.Write("S"); //Signal

//Sterep/MONO
if (XDRPlugin._sdr.FmStereo) //If stereo checkbox is checked
{
//SP.Write("s");
SP.Write((XDRPlugin._sdr.FmPilotIsDetected) ? "s" : "m"); //We don't have acsess to vfo.SignalIsStereo
}
else
{
//SP.Write("S");
SP.Write((XDRPlugin._sdr.FmPilotIsDetected) ? "S" : "M"); //We don't have acsess to vfo.SignalIsStereo
}
serial_signal(XDRPlugin._sdr.VisualSNR, 2); //Signal
SP.Write("\n");
SP.Write("\r\n");


//RDS
Expand All @@ -238,8 +237,14 @@ static void serial_signal(float level, byte precision)
}
public static void serial_hex(byte val)
{
SP.Write(((val >> 4) & 0xF).ToString("X"));
SP.Write((val & 0xF).ToString("X"));
try
{
//SP.Write("\r\n");
SP.Write(((val >> 4) & 0xF).ToString("X"));
SP.Write((val & 0xF).ToString("X"));
//SP.Write("\r\n");
}
catch{}
}
}
}

0 comments on commit ccf32cf

Please sign in to comment.