Beispiel #1
0
 unsafe static void RDSGroup(Constants.TRDSGroup *PRDSGroup)
 {
     Group = *PRDSGroup;
     UDPClient.SendGroups(Group);
     if (Group.Blk1 >= 0)
     {
         if (PI != Group.Blk1)
         {
             PI = Group.Blk1;
             //System.Windows.Forms.MessageBox.Show("New PI has been detected:" + PI.ToString("X4"));
         }
     }
 }
Beispiel #2
0
        public static void SendGroups(Constants.TRDSGroup Group)
        {
            //I cannot put NO-RDS Thread to sleep from here so need to improvise
            //Format data according to ASCII G Protocol, see https://github.com/veso266/SDRSharp.XDR/blob/master/Docs/ASCII%20G%20Protocol.md

            string data;

            data  = "G:";
            data += "\r\n";                                                                                                        //CLRF
            data += Group.Blk1.ToString("X4") + Group.Blk2.ToString("X4") + Group.Blk3.ToString("X4") + Group.Blk4.ToString("X4"); //RDS Groups: AAABBBCCCDDD
            data += "\r\n";                                                                                                        //CLRF
            data += "\r\n";                                                                                                        //CLRF

            byte[] send_buffer = Encoding.ASCII.GetBytes(data);
            try
            {
                sending_socket.SendTo(send_buffer, sending_end_point);
            }
            catch (Exception send_exception)
            {
                System.Windows.Forms.MessageBox.Show(send_exception.Message);
            }
        }