Example #1
0
        /// <summary>
        /// Decodes an 8-byte frame
        /// </summary>
        /// <param name="buffer"></param>
        /// <returns></returns>
        public RDSCommand DecodeFrame(byte[] buffer)
        {
            //Get the frame out
            RDSFrame frame = new RDSFrame
            {
                GroupA = BitConverter.ToUInt16(buffer, 0),
                GroupB = BitConverter.ToUInt16(buffer, 2),
                GroupC = BitConverter.ToUInt16(buffer, 4),
                GroupD = BitConverter.ToUInt16(buffer, 6)
            };

            return(DecodeFrame(frame));
        }
Example #2
0
        public RDSCommand DecodeFrame(RDSFrame frame)
        {
            //Decode
            RDSCommand cmd = RDSCommand.ReadRdsFrame(frame);

            //Update PI code and supported flag
            piCode       = cmd.programIdentificationCode;
            rdsSupported = true;

            //Send events
            RDSFrameReceivedEvent?.Invoke(cmd, this);

            return(cmd);
        }