示例#1
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);
        }
示例#2
0
        public void PushChange(RdsFrame frame)
        {
            //Fire events
            rdsSupported = true;
            OnRDSFrameReceived?.Invoke(frame);

            //Get the command
            RDSCommand c = RDSCommand.ReadRdsFrame(frame);

            OnRDSCommandReceived?.Invoke(c);

            //Set info
            programIdentificationCode = c.programIdentificationCode;

            //Switch on the type
            Type commandType = c.GetType();

            if (commandType == typeof(BasicDataRDSCommand))
            {
                HandleBasicDataRDSCommand((BasicDataRDSCommand)c);
            }
        }